Class Order

java.lang.Object
  extended by swarm.BaseImpl
      extended by swarm.objectbase.SwarmObjectImpl
          extended by Order
All Implemented Interfaces:
java.lang.Cloneable, swarm.defobj.Create, swarm.defobj.CreateS, swarm.defobj.Customize, swarm.defobj.CustomizeS, swarm.defobj.DefinedObject, swarm.defobj.DefinedObjectS, swarm.defobj.Drop, swarm.defobj.DropS, swarm.defobj.GetName, swarm.defobj.GetNameS, swarm.objectbase.SwarmObject, swarm.objectbase.SwarmObjectS

public class Order
extends swarm.objectbase.SwarmObjectImpl
implements java.lang.Cloneable

The form containing our Order metaphoric object

Author:
Pietro Terna (with Paolo Pelligra and Dario Landini contibutions)

Field Summary
 ComputationalSpecificationSet aComputationalSpecificationSet
          computational specification set
 swarm.collections.ListImpl computationalSpecificationSetList
          the list of the computational specification set
 int dim
          the dimension of matrixAddress
 int i
          indexes used in a common way in the arrangeForComputation method
 int j
          indexes used in a common way in the arrangeForComputation method
 int jj
          indexes used in a common way in the arrangeForComputation method
 int k
          indexes used in a common way in the arrangeForComputation method
 java.lang.Object[] matrixAddress
          the vector of memory matrix addresses to be set in a computational specification set
 int numberOfTicksAsUnsent
          number of ticks the order is in this unit as unsent
 int orderLayer
          the layer to which the order belongs; this value is not used here but in jesframe; here is kept (always 0) for compatibility reasons
 int orderNumber
          the number of this order
 int[] orderRecipe
          integer vector, containing the recipe steps
 int[] orderRecipeTmp
          a temporary vector to redefine the dimension of orderRecipe if necessary (using "p" or "c" or "||" or "&&" steps)
 int[] orderState
          integer vector, recording the performed phases
 int[] orderStateTmp
          a temporary vector to redefine the dimension of orderState if necessary (using "p" or "c" or "||" or "&&" steps)
 int[] r
          incoming recipe structure; we make a local copy of it, from r0 which is in the constructor paramenter list, to r
 java.lang.String recipeName
          the 'name' of the recipe (may be used by OrderDistiller, as a way to identify recipes
 int startingTimeUnit
          the day in which the order as been generated
 int stepNumber
          the number of steps in the product recipe
 Unit theUnitTheOrderComesFrom
          the unit the order come from (null at the beginning, coming from distiller or generator) NB must be a different unit, i.e.
 Unit theUnitTheOrderIsIn
          the unit the order is in, set from assign() in AssigningTool
 
Constructor Summary
Order(swarm.defobj.Zone aZone, int n, int sd, int sn, int[] r0, ESFrameModelSwarm model)
          the constructor for Order
 
Method Summary
 void arrangeForComputation()
          the internal method dealing with computation
 boolean checkIfNextStepUsesAComputationalSpecificationSet()
          check if next step in Order uses a computational specification set
 boolean checkZeroTimeProduction()
          check if next step in order is a zero time step
 void drop()
          drop the order
 int getDoneStep()
          production done step in Order (it is in the orderRecipe vector, at the index value in which we find the first 0 in orderState vector minus 1; if no step has been done, the method returns -999999)
 int getNextStep()
          production next step in Order (it is in the orderRecipe vector, at the same index value in which we find the first 0 in orderState vector)
 float getNumberOfDirectStepsDone()
          evaluate the number of direct steps done
 int getNumberOfTicksAsUnsent()
          getting the number of ticks that the order is in the dailyProductionList of a Unit, as unsent
 int getOrderLayer()
          getting the layer to which the order belongs
 int getOrderNumber()
          returning the orderNumber of this order
 int getOrderRecipe(int i)
          getting the content of orderRecipe[i]
 int getOrderState(int i)
          getting the content of orderState[i]
 java.lang.Object getPendingComputationalSpecificationSet()
          getting the computational specification set related to the nextStep (the current one, if the order is in a waiting list for next step to be accomplished)
if no computational specification set exists for the next step, a null value is returned
 java.lang.String getRecipeName()
          retrieving the name of the recipe
 int getStartingTimeUnit()
          returning the startingTimeUnit
 int getStepNumber()
          returning the stepNumber
 Unit getTheUnitTheOrderComesFrom()
          get the unit the order comes from
 Unit getTheUnitTheOrderIsIn()
          get the unit the order is in
 boolean getWholeZeroTimeOrder()
          zero time whole order
 void init(swarm.defobj.Zone aZone, int n, int sd, int sn, int[] r0, ESFrameModelSwarm model)
          managing the constructor content
 void setDoneStep(int u)
          Done step in Order
 void setNumberOfTicksAsUnsent(int n)
          setting (initializing) the number of ticks that the order is in the dailyProductionList of a Unit; the setting is made in unitStep2; the initial value is set in unitStep1
 void setRecipeName(java.lang.String s)
          settinging the name of the recipe
 void setTheUnitTheOrderIsIn(Unit in)
          set the unit the order is in (from assign() in AssigningTool)
 
Methods inherited from class swarm.objectbase.SwarmObjectImpl
compare, describe, describeID, getCompleteProbeMap, getDisplayName, getName, getProbeForMessage, getProbeForVariable, getProbeMap, getTypeName, getZone, perform, perform$with, perform$with$with, perform$with$with$with, respondsTo, setDisplayName, xfprint, xfprintid, xprint, xprintid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stepNumber

public int stepNumber
the number of steps in the product recipe


recipeName

public java.lang.String recipeName
the 'name' of the recipe (may be used by OrderDistiller, as a way to identify recipes


orderLayer

public int orderLayer
the layer to which the order belongs; this value is not used here but in jesframe; here is kept (always 0) for compatibility reasons


orderNumber

public int orderNumber
the number of this order


startingTimeUnit

public int startingTimeUnit
the day in which the order as been generated


orderRecipe

public int[] orderRecipe
integer vector, containing the recipe steps


orderRecipeTmp

public int[] orderRecipeTmp
a temporary vector to redefine the dimension of orderRecipe if necessary (using "p" or "c" or "||" or "&&" steps)


orderStateTmp

public int[] orderStateTmp
a temporary vector to redefine the dimension of orderState if necessary (using "p" or "c" or "||" or "&&" steps)


orderState

public int[] orderState
integer vector, recording the performed phases


numberOfTicksAsUnsent

public int numberOfTicksAsUnsent
number of ticks the order is in this unit as unsent


theUnitTheOrderComesFrom

public Unit theUnitTheOrderComesFrom
the unit the order come from (null at the beginning, coming from distiller or generator) NB must be a different unit, i.e. we do not register here the assignnment to the same unit or to a unit executing the same step


theUnitTheOrderIsIn

public Unit theUnitTheOrderIsIn
the unit the order is in, set from assign() in AssigningTool


aComputationalSpecificationSet

public ComputationalSpecificationSet aComputationalSpecificationSet
computational specification set


computationalSpecificationSetList

public swarm.collections.ListImpl computationalSpecificationSetList
the list of the computational specification set


matrixAddress

public java.lang.Object[] matrixAddress
the vector of memory matrix addresses to be set in a computational specification set


dim

public int dim
the dimension of matrixAddress


i

public int i
indexes used in a common way in the arrangeForComputation method


j

public int j
indexes used in a common way in the arrangeForComputation method


jj

public int jj
indexes used in a common way in the arrangeForComputation method


k

public int k
indexes used in a common way in the arrangeForComputation method


r

public int[] r
incoming recipe structure; we make a local copy of it, from r0 which is in the constructor paramenter list, to r

Constructor Detail

Order

public Order(swarm.defobj.Zone aZone,
             int n,
             int sd,
             int sn,
             int[] r0,
             ESFrameModelSwarm model)
the constructor for Order

Method Detail

init

public void init(swarm.defobj.Zone aZone,
                 int n,
                 int sd,
                 int sn,
                 int[] r0,
                 ESFrameModelSwarm model)
managing the constructor content


arrangeForComputation

public void arrangeForComputation()
the internal method dealing with computation


getNextStep

public int getNextStep()
production next step in Order (it is in the orderRecipe vector, at the same index value in which we find the first 0 in orderState vector)


getDoneStep

public int getDoneStep()
production done step in Order (it is in the orderRecipe vector, at the index value in which we find the first 0 in orderState vector minus 1; if no step has been done, the method returns -999999)


getOrderLayer

public int getOrderLayer()
getting the layer to which the order belongs


setDoneStep

public void setDoneStep(int u)
Done step in Order


getOrderNumber

public int getOrderNumber()
returning the orderNumber of this order


getStepNumber

public int getStepNumber()
returning the stepNumber


getStartingTimeUnit

public int getStartingTimeUnit()
returning the startingTimeUnit


getNumberOfDirectStepsDone

public float getNumberOfDirectStepsDone()
evaluate the number of direct steps done


getOrderRecipe

public int getOrderRecipe(int i)
getting the content of orderRecipe[i]


getOrderState

public int getOrderState(int i)
getting the content of orderState[i]


setRecipeName

public void setRecipeName(java.lang.String s)
settinging the name of the recipe


getRecipeName

public java.lang.String getRecipeName()
retrieving the name of the recipe


checkIfNextStepUsesAComputationalSpecificationSet

public boolean checkIfNextStepUsesAComputationalSpecificationSet()
check if next step in Order uses a computational specification set


checkZeroTimeProduction

public boolean checkZeroTimeProduction()
check if next step in order is a zero time step


getPendingComputationalSpecificationSet

public java.lang.Object getPendingComputationalSpecificationSet()
getting the computational specification set related to the nextStep (the current one, if the order is in a waiting list for next step to be accomplished)
if no computational specification set exists for the next step, a null value is returned


setTheUnitTheOrderIsIn

public void setTheUnitTheOrderIsIn(Unit in)
set the unit the order is in (from assign() in AssigningTool)


getTheUnitTheOrderIsIn

public Unit getTheUnitTheOrderIsIn()
get the unit the order is in


getTheUnitTheOrderComesFrom

public Unit getTheUnitTheOrderComesFrom()
get the unit the order comes from


setNumberOfTicksAsUnsent

public void setNumberOfTicksAsUnsent(int n)
setting (initializing) the number of ticks that the order is in the dailyProductionList of a Unit; the setting is made in unitStep2; the initial value is set in unitStep1


getNumberOfTicksAsUnsent

public int getNumberOfTicksAsUnsent()
getting the number of ticks that the order is in the dailyProductionList of a Unit, as unsent


getWholeZeroTimeOrder

public boolean getWholeZeroTimeOrder()
zero time whole order


drop

public void drop()
drop the order

Specified by:
drop in interface swarm.defobj.Drop
Overrides:
drop in class swarm.objectbase.SwarmObjectImpl