Code: Select all
public class TestEvent
{
@PlanningId
private Long id;
private String name;
private int duration;
// Not yet making use of this - this makes the need for a test
// conductor "optional"
private boolean conductorRequired;
// Not yet making use of this - this makes support staff have
// a multiplicity of [0..n]
private int supportStaffRequiredCount;
}
@PlanningEntity
public Class TestEventAssignment
{
@PlanningId
private Long id;
@PlanningVariable
private TimeGrain startingTimeGrain;
private TestEvent testEvent;
// This works for a single conductor, I am able to write constraints
// to ensure the conductor is available at the same time the test
// event is scheduled in the testing facility
//
// Q1: Part of my question involves how to have this become 'optional'
// based on what the test event is demanding?
@PlanningVariable
private Conductor conductor;
// This is successfully working as coded.
// Q2: How do I transform this so that, based on the demands of the
// testEvent, this might need to have 0, or 1, or 2, . .?
@PlanningVariable
private SupportStaff supportStaff;
}
@PlanningSolution
public class Schedule {
@ProblemFactCollectionProperty
private List testEventList;
@ValueRangeProvider
@ProblemFactCollectionProperty
private List testEnvironmentAvailability;
@ValueRangeProvider
@ProblemFactCollectionProperty
private List conductorList;
@ProblemFactCollectionProperty
private List silSupportList;
@PlanningScore
private HardSoftScore score;
. . .
}