Package jobshop
Class Instance
java.lang.Object
jobshop.Instance
Represents an instance of a JobShop problem.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int[][]Matrix containing the duration of all tasks.(package private) final int[][]Matrix containing the machine on which each task must be scheduled.final StringName of the instance.final intNumber of jobs in the instancefinal intNumber of machines, assumed to be same as number of tasks.final intNumber of tasks per job -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintduration(int job, int task) Duration of the given task.intDuration of the given task.static InstanceParses a instance from a file.intmachine(int job, int task) Machine on which the given task must be scheduled.intMachine on which the given task must be scheduled.inttask_with_machine(int job, int wanted_machine) Among the tasks of the given job, returns the task number of the one that uses the given machine.
-
Field Details
-
name
Name of the instance. Same as the filename from which the instance is loaded. -
numJobs
public final int numJobsNumber of jobs in the instance -
numTasks
public final int numTasksNumber of tasks per job -
numMachines
public final int numMachinesNumber of machines, assumed to be same as number of tasks. -
durations
final int[][] durationsMatrix containing the duration of all tasks. -
machines
final int[][] machinesMatrix containing the machine on which each task must be scheduled.
-
-
Constructor Details
-
Instance
Instance(String name, int numJobs, int numTasks) Creates a new instance, with uninitialized durations and machines. This should no be called directly. Instead, Instance objects should be created with theInstance.fromFile()static method.
-
-
Method Details
-
duration
public int duration(int job, int task) Duration of the given task. -
duration
Duration of the given task. -
machine
public int machine(int job, int task) Machine on which the given task must be scheduled. -
machine
Machine on which the given task must be scheduled. -
task_with_machine
public int task_with_machine(int job, int wanted_machine) Among the tasks of the given job, returns the task number of the one that uses the given machine. -
fromFile
Parses a instance from a file.- Throws:
IOException
-