Как правильно построить настройку Optaplanner, чтобы обработать дополнительную @PlanningVariable и @PlanningVariable с мJAVA

Программисты JAVA общаются здесь
Anonymous
 Как правильно построить настройку Optaplanner, чтобы обработать дополнительную @PlanningVariable и @PlanningVariable с м

Сообщение Anonymous »

Общая проблема ограничения здесь состоит в том, чтобы планировать события тестирования, в которых есть персонал. Персонал и объект для планирования тестового события имеют независимую доступность времени. Мне удалось успешно получить следующую работу, но мне нужно расширить проблему на «необязательный» персонал и персонал, где [0..n] определенного типа может потребоваться тестовым событием. < /P>
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;
. . .
}


Подробнее здесь: https://stackoverflow.com/questions/794 ... -planningv

Вернуться в «JAVA»