本文整理汇总了Java中org.optaplanner.core.api.domain.variable.PlanningVariable类的典型用法代码示例。如果您正苦于以下问题:Java PlanningVariable类的具体用法?Java PlanningVariable怎么用?Java PlanningVariable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlanningVariable类属于org.optaplanner.core.api.domain.variable包,在下文中一共展示了PlanningVariable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPlannerAnnotations
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的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;
}
示例2: fieldPlanningEntitySettings
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@Test
public void fieldPlanningEntitySettings() {
PlannerDataObjectFieldEditor fieldEditor = createFieldEditor();
//first configure the DataObject as a PlanningEntity
DataObject dataObject = context.getDataObject();
dataObject.addAnnotation(new AnnotationImpl(context.getAnnotationDefinition(PlanningEntity.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);
//emulate the user input
when(view.getPlanningVariableValue()).thenReturn(true);
when(view.getValueRangeProviderRefsValue()).thenReturn("valueRangeProviderRefsValue");
fieldEditor.onPlanningVariableChange();
fieldEditor.onValueRangeProviderRefsChange();
List<String> valueRangeProviderRefs = new ArrayList<String>();
valueRangeProviderRefs.add("valueRangeProviderRefsValue");
assertNotNull(field1.getAnnotation(PlanningVariable.class.getName()));
assertEquals(valueRangeProviderRefs,
field1.getAnnotation(PlanningVariable.class.getName()).getValue("valueRangeProviderRefs"));
}
示例3: getPreviousVisit
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@Nullable
@PlanningVariable(strengthComparatorClass = VisitStrengthComparator.class,
valueRangeProviderRefs = {
PDPSolution.PARCEL_RANGE,
PDPSolution.VEHICLE_RANGE
},
graphType = PlanningVariableGraphType.CHAINED)
public Visit getPreviousVisit() {
return previousVisit;
}
示例4: getEmployee
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = {"employeeRange"}, strengthComparatorClass = EmployeeStrengthComparator.class)
public Employee getEmployee() {
return employee;
}
示例5: getHostAssociated
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = {"hostRange"},
strengthComparatorClass = HostStrengthComparator.class)
public Host getHostAssociated() {
return hostAssociated;
}
示例6: getRoom
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = "roomsProvider", strengthComparatorClass = Room.RoomByCapacity.class)
public Room getRoom() {
return room;
}
示例7: getSlot
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = "timeslotsProvider")
public Timeslot getSlot() {
return slot;
}
示例8: getComputer
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = {"computerRange"},
strengthComparatorClass = CloudComputerStrengthComparator.class)
public CloudComputer getComputer() {
return computer;
}
示例9: getPreviousRouteAction
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = {"transportRange", "commodityActionRange"},
graphType = PlanningVariableGraphType.CHAINED)
public RouteAction getPreviousRouteAction() {
return previousRouteAction;
}
示例10: getHorario
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = {"Horario"},
strengthComparatorClass = HorarioStrengthComparator.class)
public Horario getHorario() {
return horario;
}
示例11: getTask
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = { "tasks" }, nullable = true )
public Task getTask() {
return task;
}
示例12: getPreviousStandstill
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = {"reindeerRange", "giftAssignmentRange"},
graphType = PlanningVariableGraphType.CHAINED)
public Standstill getPreviousStandstill() {
return previousStandstill;
}
示例13: getColor
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = {"colorRange"})
public Color getColor() {
return color;
}
示例14: getInside
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = {"insideRange"})
public Boolean getInside() {
return inside;
}
示例15: getFaculty
import org.optaplanner.core.api.domain.variable.PlanningVariable; //导入依赖的package包/类
@PlanningVariable(valueRangeProviderRefs = {"facultyRange"})
public Faculty getFaculty() {
return faculty;
}