net.sf.cpsolver.ifs.example.jobshop
Class JobShopModel

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Model
      extended by net.sf.cpsolver.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:


Output file firmat:

Version:
IFS 1.1 (Iterative Forward Search)
Copyright (C) 2006 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Field Summary
 
Fields inherited from class net.sf.cpsolver.ifs.model.Model
iAssignedVariables, iPerturbVariables, iUnassignedVariables, sDoubleFormat, sPercentageFormat, sTimeFormat
 
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 net.sf.cpsolver.ifs.model.Model
addConstraint, addGlobalConstraint, addModelListener, addVariable, afterAssigned, afterUnassigned, assignedVariables, beforeAssigned, beforeUnassigned, bestUnassignedVariables, clearBest, conflictConstraints, conflictValues, constraints, countConstraints, countGlobalConstraints, countVariables, getBestPerturbations, getBestUnassignedVariables, getExtendedInfo, getInfo, getInfoProviders, getModelListeners, getPerc, getPercRev, getTotalValue, getTotalValue, globalConstraints, inConflict, init, invalidateVariablesWithInitialValueCache, modelListenerOfType, nrAssignedVariables, nrUnassignedVariables, perturbVariables, perturbVariables, removeConstraint, removeGlobalConstraint, removeModelListener, removeVariable, restoreBest, saveBest, toString, unassignedHardConstraints, unassignedVariables, variables, variablesWithInitialValue
 
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