public class Job extends Constraint<Operation,Location>
iConstraintListeners, iId
Constructor and Description |
---|
Job(int jobNumber)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
computeConflicts(Assignment<Operation,Location> assignment,
Location location,
Set<Location> conflicts)
Adds conflicting operations into the set of conflicts.
|
int |
countOperations()
Count job operations for the job (i.e., the number of variables in this
constraint)
|
int |
getDueTime()
Get due time
|
int |
getJobNumner()
Get job number
|
String |
getName()
Name of the job (e.g.
|
Operation |
getOperation(int opNumber)
Get operation of the given index (0..countOperations()-1)
|
boolean |
inConflict(Assignment<Operation,Location> assignment,
Location location)
True if there is an operation from the same job which violates with the
given assignment.
|
boolean |
isConsistent(Location location1,
Location location2)
True if the two assignments (placement of opeartions of the same job in
time) violates each other.
|
void |
setDueTime(int dueTime)
Set due time
|
String |
toString()
String representation -- for debuging and printing purposes
|
addConstraintListener, addVariable, assigned, assignedVariables, compareTo, computeConflictsNoForwardCheck, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, unassigned, variables
public Job(int jobNumber)
jobNumber
- job numberpublic void setDueTime(int dueTime)
dueTime
- due timepublic int getDueTime()
public int getJobNumner()
public int countOperations()
public Operation getOperation(int opNumber)
opNumber
- operation numberpublic void computeConflicts(Assignment<Operation,Location> assignment, Location location, Set<Location> conflicts)
computeConflicts
in class Constraint<Operation,Location>
assignment
- current assignmentlocation
- value to be assigned to its variableconflicts
- resultant set of conflicting valuespublic boolean inConflict(Assignment<Operation,Location> assignment, Location location)
inConflict
in class Constraint<Operation,Location>
assignment
- current assignmentlocation
- given valuepublic boolean isConsistent(Location location1, Location location2)
isConsistent
in class Constraint<Operation,Location>
location1
- a valuelocation2
- a value