public static class GroupConstraint.ParametrizedConstraintType<P> extends Object implements GroupConstraint.ConstraintTypeInterface
Constructor and Description |
---|
ParametrizedConstraintType(GroupConstraint.ConstraintType type,
P parameter,
String reference)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getMax()
Maximum (gap, hours a day) parameter
|
int |
getMin()
Minimum (gap) parameter
|
String |
getName()
Constraint name
|
P |
getParameter()
Return constraint's parameter
|
boolean |
is(GroupConstraint.Flag f)
Flag check (true if contains given flag)
|
boolean |
isSatisfied(Assignment<Lecture,Placement> assignment,
GroupConstraint gc,
Placement plc1,
Placement plc2)
Check whether the constraint is satisfied for the given two assignments (required / preferred case)
|
boolean |
isViolated(Assignment<Lecture,Placement> assignment,
GroupConstraint gc,
Placement plc1,
Placement plc2)
Check whether the constraint is satisfied for the given two assignments (prohibited / discouraged case)
|
String |
reference()
Constraint reference
|
GroupConstraint.ParametrizedConstraintType<P> |
setMax(int max) |
GroupConstraint.ParametrizedConstraintType<P> |
setMin(int min) |
GroupConstraint.ParametrizedConstraintType<P> |
setName(String name) |
GroupConstraint.ConstraintType |
type()
Constraint type
|
public ParametrizedConstraintType(GroupConstraint.ConstraintType type, P parameter, String reference)
type
- constraint typeparameter
- parameter parsed from the reference using GroupConstraint.AssignmentParameterPairCheck.create(String, String)
reference
- constraint reference with parameterspublic boolean isSatisfied(Assignment<Lecture,Placement> assignment, GroupConstraint gc, Placement plc1, Placement plc2)
GroupConstraint.AssignmentPairCheck
isSatisfied
in interface GroupConstraint.AssignmentPairCheck
assignment
- current assignmentgc
- Calling group constraintplc1
- First placementplc2
- Second placementpublic boolean isViolated(Assignment<Lecture,Placement> assignment, GroupConstraint gc, Placement plc1, Placement plc2)
GroupConstraint.AssignmentPairCheck
isViolated
in interface GroupConstraint.AssignmentPairCheck
assignment
- current assignmentgc
- Calling group constraintplc1
- First placementplc2
- Second placementpublic P getParameter()
public GroupConstraint.ConstraintType type()
GroupConstraint.ConstraintTypeInterface
type
in interface GroupConstraint.ConstraintTypeInterface
public String reference()
GroupConstraint.ConstraintTypeInterface
reference
in interface GroupConstraint.ConstraintTypeInterface
public String getName()
GroupConstraint.ConstraintTypeInterface
getName
in interface GroupConstraint.ConstraintTypeInterface
public int getMin()
GroupConstraint.ConstraintTypeInterface
getMin
in interface GroupConstraint.ConstraintTypeInterface
public int getMax()
GroupConstraint.ConstraintTypeInterface
getMax
in interface GroupConstraint.ConstraintTypeInterface
public boolean is(GroupConstraint.Flag f)
GroupConstraint.ConstraintTypeInterface
is
in interface GroupConstraint.ConstraintTypeInterface
f
- a flag to checkpublic GroupConstraint.ParametrizedConstraintType<P> setMin(int min)
public GroupConstraint.ParametrizedConstraintType<P> setMax(int max)
public GroupConstraint.ParametrizedConstraintType<P> setName(String name)