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) 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 String
    Name of the instance.
    final int
    Number of jobs in the instance
    final int
    Number of machines, assumed to be same as number of tasks.
    final int
    Number of tasks per job
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instance(String name, int numJobs, int numTasks)
    Creates a new instance, with uninitialized durations and machines.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    duration(int job, int task)
    Duration of the given task.
    int
    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 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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 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 the Instance.fromFile() static method.
  • Method Details

    • 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