haifa.shopsim
Class ShopCommand

java.lang.Object
  |
  +--haifa.shopsim.ShopCommand

public final class ShopCommand
extends java.lang.Object

This is a command generated by a scheduling algorithm to a job shop simulator. It tells the shop what to do next. Machines are identified using the machine number.

Version:
1.1

Field Summary
protected  int code
          The type of command, schedule, quit, etc...
static int CODE_QUIT
          when code has this value it means that the command is to quit the work of the job shop.
static int CODE_REST
          when code has this value, it means that the command is to rest, (not do anything).
static int CODE_SCHEDULE
          when code has this value it means that this is a scheduling command.
protected  int machine
          The machine that should do this command.
protected  Operation operation
          The operation to schedule.
 
Constructor Summary
ShopCommand(int machine_, int code_)
          Constructs a shop command.
ShopCommand(int machine_, Operation operation_)
          Constructs a shop command with CODE_SCHEDULE
 
Method Summary
 int getMachine()
          Returns the machine of the command.
 Operation getOperation()
          Returns the operation that is to be scheduled.
 boolean isQuit()
          Ask if the command is a quit command.
 boolean isRest()
          Ask if the command is a rest command.
 boolean isSchedule()
          Ask if the command is a schedule command
 void setOperation(Operation operation_)
          Set the operation.
 java.lang.String toString()
          Returns a string with quite a bit info about the command.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

code

protected int code
The type of command, schedule, quit, etc...

machine

protected int machine
The machine that should do this command.

operation

protected Operation operation
The operation to schedule.

CODE_SCHEDULE

public static final int CODE_SCHEDULE
when code has this value it means that this is a scheduling command.

CODE_QUIT

public static final int CODE_QUIT
when code has this value it means that the command is to quit the work of the job shop.

CODE_REST

public static final int CODE_REST
when code has this value, it means that the command is to rest, (not do anything).
Constructor Detail

ShopCommand

public ShopCommand(int machine_,
                   int code_)
Constructs a shop command.

ShopCommand

public ShopCommand(int machine_,
                   Operation operation_)
Constructs a shop command with CODE_SCHEDULE
Method Detail

setOperation

public void setOperation(Operation operation_)
Set the operation.

getMachine

public int getMachine()
Returns the machine of the command.

getOperation

public Operation getOperation()
Returns the operation that is to be scheduled.

isQuit

public boolean isQuit()
Ask if the command is a quit command.

isSchedule

public boolean isSchedule()
Ask if the command is a schedule command

isRest

public boolean isRest()
Ask if the command is a rest command.

toString

public java.lang.String toString()
Returns a string with quite a bit info about the command.
Overrides:
toString in class java.lang.Object