public class JobShopModel extends Model<Operation,Location>
<number of jobs> <number of machines>
Following lines:
space separated list (a line for each job) of operations, each operation consist of machine number and operation processing timeExample of 10 jobs, 10 machines:
10 10
4 88 8 68 6 94 5 99 1 67 2 89 9 77 7 99 0 86 3 92
5 72 3 50 6 69 4 75 2 94 8 66 0 92 1 82 7 94 9 63
9 83 8 61 0 83 1 65 6 64 5 85 7 78 4 85 2 55 3 77
7 94 2 68 1 61 4 99 3 54 6 75 5 66 0 76 9 63 8 67
3 69 4 88 9 82 8 95 0 99 2 67 6 95 5 68 7 67 1 86
1 99 4 81 5 64 6 66 8 80 2 80 7 69 9 62 3 79 0 88
7 50 1 86 4 97 3 96 0 95 8 97 2 66 5 99 6 52 9 71
4 98 6 73 3 82 2 51 1 71 5 94 7 85 0 62 8 95 9 79
0 94 6 71 3 81 7 85 1 66 2 90 4 76 5 58 8 93 9 97
3 50 0 59 1 82 8 67 7 56 9 96 6 58 4 81 5 59 2 96
For instance, the first job is described as follows:
88 time units on machine 4, then 68 time units on machine 8, then 94 time units on machine 6 ...
A line for each machine, in each line there is a space separated list of jobs which the machine will process in the order they will be processed.
sDoubleFormat, sPercentageFormat, sTimeFormat
Constructor and Description |
---|
JobShopModel(int nrMachines,
int nrJobs)
Constructor �
|
Modifier and Type | Method and Description |
---|---|
int |
countJobs()
Count number of jobs in the model
|
int |
countMachines()
Count number of machines in the model
|
int |
getFinishingTime(Assignment<Operation,Location> assignment)
Get finishing time of the current (partial) solution
|
Map<String,String> |
getInfo(Assignment<Operation,Location> assignment)
Get information table
|
Job |
getJob(int jobNumber)
Get job of the given number
|
Machine |
getMachine(int machineNumber)
Get machine of the given number
|
int |
getTotalNumberOfSlots()
Get total number of slots
|
static JobShopModel |
loadModel(String file)
Loads the model from the given file
|
void |
save(Assignment<Operation,Location> assignment,
String file)
Save the solution into the given file
|
addConstraint, addCriterion, addGlobalConstraint, addModelListener, addVariable, afterAssigned, afterAssigned, afterUnassigned, afterUnassigned, assignedVariables, assignedVariables, beforeAssigned, beforeAssigned, beforeUnassigned, beforeUnassigned, bestUnassignedVariables, bestUnassignedVariables, clearAssignmentContexts, clearBest, conflictConstraints, conflictValues, conflictValues, constraints, countConstraints, countGlobalConstraints, countVariables, createAssignmentContexts, createInheritedAssignment, createReference, getBestPerturbations, getBestUnassignedVariables, getBestValue, getCriteria, getCriterion, getDefaultAssignment, getEmptyAssignment, getExtendedInfo, getExtendedInfo, getInfo, getInfo, getInfo, getInfoProviders, getModelListeners, getPerc, getPercRev, getTotalValue, getTotalValue, getTotalValue, getTotalValue, globalConstraints, inConflict, inConflict, init, invalidateVariablesWithInitialValueCache, modelListenerOfType, nrAssignedVariables, nrAssignedVariables, nrUnassignedVariables, nrUnassignedVariables, perturbVariables, perturbVariables, perturbVariables, perturbVariables, perturbVariables, removeConstraint, removeCriterion, removeCriterion, removeGlobalConstraint, removeModelListener, removeReference, removeVariable, restoreBest, restoreBest, restoreBest, saveBest, saveBest, setBestValue, setDefaultAssignment, toString, toString, unassignedHardConstraints, unassignedVariables, unassignedVariables, variables, variablesWithInitialValue, weaken
public JobShopModel(int nrMachines, int nrJobs)
nrMachines
- number of machinesnrJobs
- number of jobspublic int getTotalNumberOfSlots()
public Machine getMachine(int machineNumber)
machineNumber
- machine numberpublic int countMachines()
public Job getJob(int jobNumber)
jobNumber
- job numberpublic int countJobs()
public static JobShopModel loadModel(String file) throws IOException
file
- file to loadIOException
- thrown when there is a problem reading the input filepublic int getFinishingTime(Assignment<Operation,Location> assignment)
assignment
- current assignmentpublic Map<String,String> getInfo(Assignment<Operation,Location> assignment)
public void save(Assignment<Operation,Location> assignment, String file) throws IOException
assignment
- current assignmentfile
- file to writeIOException
- throw when there is a problem writing the file