* 史忠植 约束推理 * ILOG Schedule 1.0 Resources ? ? CtResource ? CtDiscreteResource ? CtUnaryResource ? CtDiscreteEnergy CtStateResource * 史忠植 约束推理 * ILOG Schedule 1.0 Activities ? CtActivity class ? CtIntervalActivity ? ? An activity is defined by its start time, end time and duration ? Activities require, provide, consume and produce resources * 史忠植 约束推理 * Scheduling Problem Prices paid as tasks begin $1000 per day Availability: Day 0:$20000, Day 15: +$9000 * 史忠植 约束推理 * Constraints // To create a schedule with origin 0 and given horizon. CtSchedule* schedule = new CtSchedule(0, horizon); ? // To create an activity with the given duration. CtIntervalActivity* act = new CtIntervalActivity(schedule, duration); ? //To post a precedence constraint between act1 and act2. act2-startsAfterEnd(act1,0); ? ? * 史忠植 约束推理 * Constraints //To create a total budget of limited capacity (here 29000). CtDiscreteResource* res = new CtDiscreteResource(schedule, CtRequiredResource, capacity); ? // To state that only cap (here 20000) is available prior to a // given date (here 15). res-setCapacityMax(0,date,cap); ? // To state that an activity act consumes c units of res. act-consumes(res, c); * 史忠植 约束推理 * Algorithm Program CtBoolean IsUnScheduled(CtActivity* act){ // Return true if act does not have a fixed start time. if (act-getStartVariable()-isBound()) return CtFalse; else return CtTrue; } * 史忠植 约束推理 * Algorithm Program CtBoolean IsMoreUrgent(CtActivity* act1, CtActivity* act2){ // Returns true if act1 is more urgent than act2. // Returns true if act2 is unbound (==0) if (act2 == 0) return CtTrue; else if (act1-getStartMax() act2-getStartMax()) return CtTrue

文档评论(0)

1亿VIP精品文档

相关文档