Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ifs.example.jobshop
Class JobShopModel

    java.lang.Object
      ifs.model.Model
          ifs.example.jobshop.JobShopModel

    public class JobShopModel

extends Model

Job Shop model.
It contains the number of available time slots and all machines and jobs.
It can also load the model from a file and save the solution.
Input file format:

First line:

`<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 time

Example 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 ...

Output file firmat:

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.

Version:
  1.0
Author:
  Tomáš Müller

Constructor Summary
`JobShopModel(int nrMachines, int nrJobs)` Constructor

Method Summary
`int` | `countJobs()` Count number of jobs in the model
`int` | `countMachines()` Count number of machines in the model
`int` | `getFinishingTime()` Get finishing time of the current (partial) solution
`Hashtable` | `getInfo()` Get information table
`Job` | `getJob(int jobNumber)` Get job of the given number
`Machine` | `getMachine(int machineNumber)` Get machine of the given numbner
`int` | `getTotalNumberOfSlots()` Get total number of slots
`static JobShopModel` | `loadModel(String file)` Loads the model from the given file
`void` | `save(String file)` Save the solution into the given file

Methods inherited from class ifs.model.Model
`addConstraint, addModelListener, addVariable, afterAssigned, afterUnassigned, assignedVariables, beforeAssigned, beforeUnassigned, bestUnassignedVariables, conflictConstraints, conflictValues, constraints, countConstraints, countVariables, getBestPerturbations, getBestUnassignedVariables, getModelListeners, getTotalValue, init, modelListenerOfType, perturbVariables, removeConstraint, removeModelListener, removeVariable, restoreBest, saveBest, toString, unassignedHardConstraints, unassignedVariables, variables, variablesWithoutInitialValue`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### JobShopModel

    public JobShopModel(int nrMachines,
                        int nrJobs)

  Constructor

  Parameters:
    `nrMachines` - number of machines
    `nrJobs` - number of jobs

Method Detail

### getTotalNumberOfSlots

    public int getTotalNumberOfSlots()

  Get total number of slots

### getMachine

    public Machine getMachine(int machineNumber)

  Get machine of the given numbner

### countMachines

    public int countMachines()

  Count number of machines in the model

### getJob

    public Job getJob(int jobNumber)

  Get job of the given number

### countJobs

    public int countJobs()

  Count number of jobs in the model

### loadModel

    public static JobShopModel loadModel(String file)
                                  throws IOException

  Loads the model from the given file

  Throws:
    `IOException`

### getFinishingTime

    public int getFinishingTime()

  Get finishing time of the current (partial) solution

### getInfo

    public Hashtable getInfo()

  Get information table

  Overrides:
    `getInfo` in class `Model`

### save

    public void save(String file)
              throws IOException

  Save the solution into the given file

  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 Tomáš Müller