Package jobshop
Class Instance
- java.lang.Object
-
- jobshop.Instance
-
public final class Instance extends Object
Represents an instance of a JobShop problem.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int[][]
durations
Matrix containing the duration of all tasks.(package private) int[][]
machines
Matrix containing the machine on which each task must be scheduled.String
name
Name of the instance.int
numJobs
Number of jobs in the instanceint
numMachines
Number of machines, assumed to be same as number of tasks.int
numTasks
Number of tasks per job
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
duration(int job, int task)
Duration of the given task.int
duration(Task t)
Duration of the given task.static Instance
fromFile(Path path)
Parses a instance from a file.int
machine(int job, int task)
Machine on which the given task must be scheduled.int
machine(Task t)
Machine on which the given task must be scheduled.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.
-
-
-
Field Detail
-
name
public final String name
Name of the instance. Same as the filename from which the instance is loaded.
-
numJobs
public final int numJobs
Number of jobs in the instance
-
numTasks
public final int numTasks
Number of tasks per job
-
numMachines
public final int numMachines
Number of machines, assumed to be same as number of tasks.
-
durations
final int[][] durations
Matrix containing the duration of all tasks.
-
machines
final int[][] machines
Matrix containing the machine on which each task must be scheduled.
-
-
Constructor Detail
-
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 Detail
-
duration
public int duration(int job, int task)
Duration of the given task.
-
duration
public int duration(Task t)
Duration of the given task.
-
machine
public int machine(int job, int task)
Machine on which the given task must be scheduled.
-
machine
public int machine(Task t)
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
public static Instance fromFile(Path path) throws IOException
Parses a instance from a file.- Throws:
IOException
-
-