Package jobshop

Class 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 instance
      int numMachines
      Number of machines, assumed to be same as number of tasks.
      int numTasks
      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.
    • 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 the Instance.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.