本文整理汇总了Java中org.optaplanner.core.api.domain.valuerange.ValueRangeProvider类的典型用法代码示例。如果您正苦于以下问题:Java ValueRangeProvider类的具体用法?Java ValueRangeProvider怎么用?Java ValueRangeProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ValueRangeProvider类属于org.optaplanner.core.api.domain.valuerange包,在下文中一共展示了ValueRangeProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllRooms
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@ValueRangeProvider(id = "roomTimeslots")
@ProblemFactCollectionProperty
@JsonIgnore
public List<RoomTimeslot> getAllRooms() {
Set<RoomTimeslot> res = new LinkedHashSet<>();
Map<Room, List<RoomTimeslot>> customAvailable = groupSlots(getRoomAvailability());
Map<Room, List<RoomTimeslot>> customUnavailable = groupSlots(getRoomUnavailability());
for (Room room : getRooms()) {
List<RoomTimeslot> timeslots = customAvailable.get(room);
if (timeslots != null) {
res.addAll(timeslots);
continue;
}
for (Timeslot timeslot : getTimeslots()) {
res.add(new RoomTimeslot(room, timeslot));
}
timeslots = customUnavailable.get(room);
if (timeslots != null) {
res.removeAll(timeslots);
}
}
return new ArrayList<>(res);
}
示例2: getPlannerAnnotations
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
public static Map<String, AnnotationDefinition> getPlannerAnnotations() {
HashMap<String, AnnotationDefinition> annotations = new HashMap<String, AnnotationDefinition>();
annotations.put(PlanningEntity.class.getName(),
DriverUtils.buildAnnotationDefinition(PlanningEntity.class));
annotations.put(PlanningSolution.class.getName(),
DriverUtils.buildAnnotationDefinition(PlanningSolution.class));
annotations.put(PlanningVariable.class.getName(),
DriverUtils.buildAnnotationDefinition(PlanningVariable.class));
annotations.put(ValueRangeProvider.class.getName(),
DriverUtils.buildAnnotationDefinition(ValueRangeProvider.class));
return annotations;
}
示例3: planningSolutionSettings
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@Test
public void planningSolutionSettings() {
PlannerDataObjectFieldEditor fieldEditor = createFieldEditor();
//first configure the DataObject as a PlanningSolution
DataObject dataObject = context.getDataObject();
dataObject.addAnnotation(new AnnotationImpl(context.getAnnotationDefinition(PlanningSolution.class.getName())));
dataObject.addProperty("score",
HardSoftScore.class.getName());
ObjectProperty field1 = dataObject.getProperty("field1");
//emulates the selection of field1
context.setObjectProperty(field1);
//The domain editors typically reacts upon DataModelerContext changes.
//when the context changes the editor will typically be reloaded.
fieldEditor.onContextChange(context);
when(view.getValueRangeProviderValue()).thenReturn(true);
when(view.getValueRangeProviderIdValue()).thenReturn("valueRangeProviderIdValue");
//emulate the user input
fieldEditor.onValueRangeProviderChange();
fieldEditor.onValueRangeProviderIdChange();
assertNotNull(field1.getAnnotation(ValueRangeProvider.class.getName()));
assertEquals("valueRangeProviderIdValue",
AnnotationValueHandler.getStringValue(field1,
ValueRangeProvider.class.getName(),
"id"));
}
示例4: getEmployeeList
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@ValueRangeProvider(id = "employeeRange")
public List<Employee> getEmployeeList() {
return employeeList;
}
示例5: getHostList
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@ValueRangeProvider(id = "hostRange")
@ProblemFactCollectionProperty
public List<Host> getHostList() {
return hostList;
}
示例6: getRooms
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@ValueRangeProvider(id = "roomsProvider")
@ProblemFactCollectionProperty
public List<Room> getRooms() {
return rooms;
}
示例7: getTimeslots
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@ValueRangeProvider(id = "timeslotsProvider")
@ProblemFactCollectionProperty
public List<Timeslot> getTimeslots() {
return timeslots;
}
示例8: getComputerList
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@ValueRangeProvider(id = "computerRange")
public List<CloudComputer> getComputerList() {
return computerList;
}
示例9: getTransportList
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@PlanningEntityCollectionProperty
@ValueRangeProvider(id = "transportRange")
public List<Transport> getTransportList() {
return transportList;
}
示例10: getCommodityActionList
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@PlanningEntityCollectionProperty
@ValueRangeProvider(id = "commodityActionRange")
public List<CommodityAction> getCommodityActionList() {
return commodityActionList;
}
示例11: getHorario
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@ValueRangeProvider(id = "Horario")
public List<Horario> getHorario() {
return horarios;
}
示例12: getTasks
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@ValueRangeProvider(id = "tasks")
public Set<Task> getTasks() {
return tasks;
}
示例13: getReindeerList
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@PlanningEntityCollectionProperty
@ValueRangeProvider(id = "reindeerRange")
public List<Reindeer> getReindeerList() {
return reindeerList;
}
示例14: getGiftAssignmentList
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@PlanningEntityCollectionProperty
@ValueRangeProvider(id = "giftAssignmentRange")
public List<GiftAssignment> getGiftAssignmentList() {
return giftAssignmentList;
}
示例15: getColorList
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; //导入依赖的package包/类
@ValueRangeProvider(id = "colorRange")
public List<Color> getColorList() {
return colorList;
}