Class Order

java.lang.Object
  |
  +--swarm.BaseImpl
        |
        +--swarm.objectbase.SwarmObjectImpl
              |
              +--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
 OrSpecificationSet anOrSpecificationSet
          an 'or' order specification set
 ProcurementSpecificationSet aProcurementSpecificationSet
          a procurement specification set
 SequentialBatchSpecificationSet aSequentialBatchSpecificationSet
          a sequential batch specification set
 StandAloneBatchSpecificationSet aStandAloneBatchSpecificationSet
          a stand alone batch specification set
 float cumulatedFixedCost
          the fixed and variable costs of the order
 float cumulatedVariableCost
          the fixed and variable costs of the order
 swarm.collections.ListImpl endUnitList
          the end unit list
 int i
          indexes used in a common way with the arrangeForProcurements() internal method
 boolean inSequentialBatch
          inSequentialBatch is true if the order is found to be included in a sequential batch
 int j
          indexes used in a common way with the arrangeForProcurements() internal method
 int jj
          indexes used in a common way with the arrangeForProcurements() internal method
 int k
          indexes used in a common way with the arrangeForProcurements() internal method
 int multiplicity
          multiplicity factor, usually = 1; > 1 in stand alone batch productions
 int numberOfTheStepForWhichANewsIsSent
          the sequential number of the recipe referring to which a news will be sent
 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
 float orderTotalCosts
          the sum of variable and fixed costs of the order
 swarm.collections.ListImpl orSpecificationSetList
          the list of 'or' specifications
 swarm.collections.ListImpl procuredItemList
          the list of procured items
 swarm.collections.ListImpl procurementSpecificationSetList
          the list of procurement specifications
 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
 swarm.collections.ListImpl sequentialBatchSpecificationSetList
          the list of sequential batch specifications
 swarm.collections.ListImpl standAloneBatchSpecificationSetList
          the list of stand alone batch specifications
 int startingTimeUnit
          the day in which the order as been generated
 int stepNumber
          the number of steps in the product recipe
 
Constructor Summary
Order(swarm.defobj.Zone aZone, int originalOrderRecipeLength, int[] originalOrderRecipe, int originalOrderStateLength, int[] originalOrderState, VEFrameModelSwarm model, swarm.collections.ListImpl originalProcurementSpecificationSetList, swarm.collections.ListImpl originalProcuredItemList, swarm.collections.ListImpl originalStandAloneBatchSpecificationSetList, swarm.collections.ListImpl originalSequentialBatchSpecificationSetList, swarm.collections.ListImpl originalOrSpecificationSetList, boolean originalInSequentialBatch)
          the second constructor for Order, to clone an order
the cloning operation anyway is only partial
Order(swarm.defobj.Zone aZone, int n, int sd, int sn, int[] r0, VEFrameModelSwarm model, swarm.collections.ListImpl eul)
          the first constructor for Order, for original object creation
 
Method Summary
 void arrangeForProcurements()
          the internal method dealing with procurements()
 boolean checkIfNextStepUsesAnOrSpecificationSet()
          check if next step in Order uses a 'or' specification set
 boolean checkIfNextStepUsesAProcurementSpecificationSet()
          check if next step in Order uses a procurement specification set
 boolean checkIfNextStepUsesASequentialBatchSpecificationSet()
          check if next step in Order uses a sequential batch specification set
 boolean checkIfNextStepUsesAStandAloneBatchSpecificationSet()
          check if next step in Order uses a stand alone batch specification set
 swarm.Selector checkMethod(java.lang.Object obj, java.lang.String method)
           
 java.lang.Object clone()
          Cloneable interface method: clone()
 void drop()
          drop the order
 int getHowManyStepsToBeDone()
          returning how many steps remain to terminate the production
 boolean getInSequentialBatch()
          get inSequentialBatch
 int getMultiplicity()
          get multiplicity factor
 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)
 int getNumberOfTheStepForWhichANewsIsSent()
          returning the sequential number of the recipe referring to which a news will be sent
 float getOrderEvaluation()
          returning the value of the production already done
 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]
 float getOrderTotalCosts()
          getting the total of costs of the order
 java.lang.Object getPendingOrSpecificationSet()
          getting the 'or' 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 'or' SpecificationSet exists for the next step, a null value is returned
 java.lang.Object getPendingProcurementSpecificationSet()
          getting the procurement 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 procurement specification set exists for the next step, a null value is returned
 java.lang.Object getPendingSequentialBatchSpecificationSet()
          getting the sequential batch 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 sequential batch SpecificationSet exists for the next step, a null value is returned
 java.lang.Object getPendingStandAloneBatchSpecificationSet()
          getting the stand alone batch 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 stand alone batch SpecificationSet exists for the next step, a null value is returned
 int getProductionToBeDoneAtStepAheadNumber(int sn)
          returning the production phase at a specific step
 java.lang.String getRecipeName()
          retrieving the name of the recipe
 int[] getRecipeVector()
          getting the order recipe vector address
 int getStartingTimeUnit()
          returning the startingTimeUnit
 int[] getStateVector()
          getting the order state vector address
 int getStepNumber()
          returning the stepNumber
 void setDoneStep(int u)
          Done step in Order
 void setFixedAndVariableOrderCosts(float fc, float vc)
          setting fixed and variable costs for the orders in production or finished
 void setInSequentialBatch(boolean v)
          set inSequentialBatch
 void setMultiplicity(int m)
          set multiplicity factor
 void setProcuredItemList(Order o)
          adding an item to the procuredItemList
 void setRecipeName(java.lang.String s)
          settinging the name of the recipe
 
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
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

orderNumber

public int orderNumber
the number of this order

multiplicity

public int multiplicity
multiplicity factor, usually = 1; > 1 in stand alone batch productions

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)

orderState

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

numberOfTheStepForWhichANewsIsSent

public int numberOfTheStepForWhichANewsIsSent
the sequential number of the recipe referring to which a news will be sent

cumulatedFixedCost

public float cumulatedFixedCost
the fixed and variable costs of the order

cumulatedVariableCost

public float cumulatedVariableCost
the fixed and variable costs of the order

orderTotalCosts

public float orderTotalCosts
the sum of variable and fixed costs of the order

aProcurementSpecificationSet

public ProcurementSpecificationSet aProcurementSpecificationSet
a procurement specification set

procurementSpecificationSetList

public swarm.collections.ListImpl procurementSpecificationSetList
the list of procurement specifications

aStandAloneBatchSpecificationSet

public StandAloneBatchSpecificationSet aStandAloneBatchSpecificationSet
a stand alone batch specification set

standAloneBatchSpecificationSetList

public swarm.collections.ListImpl standAloneBatchSpecificationSetList
the list of stand alone batch specifications

aSequentialBatchSpecificationSet

public SequentialBatchSpecificationSet aSequentialBatchSpecificationSet
a sequential batch specification set

sequentialBatchSpecificationSetList

public swarm.collections.ListImpl sequentialBatchSpecificationSetList
the list of sequential batch specifications

anOrSpecificationSet

public OrSpecificationSet anOrSpecificationSet
an 'or' order specification set

orSpecificationSetList

public swarm.collections.ListImpl orSpecificationSetList
the list of 'or' specifications

procuredItemList

public swarm.collections.ListImpl procuredItemList
the list of procured items

endUnitList

public swarm.collections.ListImpl endUnitList
the end unit list

inSequentialBatch

public boolean inSequentialBatch
inSequentialBatch is true if the order is found to be included in a sequential batch

i

public int i
indexes used in a common way with the arrangeForProcurements() internal method

j

public int j
indexes used in a common way with the arrangeForProcurements() internal method

jj

public int jj
indexes used in a common way with the arrangeForProcurements() internal method

k

public int k
indexes used in a common way with the arrangeForProcurements() internal 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,
             VEFrameModelSwarm model,
             swarm.collections.ListImpl eul)
the first constructor for Order, for original object creation

Order

public Order(swarm.defobj.Zone aZone,
             int originalOrderRecipeLength,
             int[] originalOrderRecipe,
             int originalOrderStateLength,
             int[] originalOrderState,
             VEFrameModelSwarm model,
             swarm.collections.ListImpl originalProcurementSpecificationSetList,
             swarm.collections.ListImpl originalProcuredItemList,
             swarm.collections.ListImpl originalStandAloneBatchSpecificationSetList,
             swarm.collections.ListImpl originalSequentialBatchSpecificationSetList,
             swarm.collections.ListImpl originalOrSpecificationSetList,
             boolean originalInSequentialBatch)
the second constructor for Order, to clone an order
the cloning operation anyway is only partial
Method Detail

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)

checkIfNextStepUsesAProcurementSpecificationSet

public boolean checkIfNextStepUsesAProcurementSpecificationSet()
check if next step in Order uses a procurement specification set

checkIfNextStepUsesAStandAloneBatchSpecificationSet

public boolean checkIfNextStepUsesAStandAloneBatchSpecificationSet()
check if next step in Order uses a stand alone batch specification set

checkIfNextStepUsesASequentialBatchSpecificationSet

public boolean checkIfNextStepUsesASequentialBatchSpecificationSet()
check if next step in Order uses a sequential batch specification set

checkIfNextStepUsesAnOrSpecificationSet

public boolean checkIfNextStepUsesAnOrSpecificationSet()
check if next step in Order uses a 'or' specification set

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

getHowManyStepsToBeDone

public int getHowManyStepsToBeDone()
returning how many steps remain to terminate the production

getProductionToBeDoneAtStepAheadNumber

public int getProductionToBeDoneAtStepAheadNumber(int sn)
returning the production phase at a specific step

getNumberOfTheStepForWhichANewsIsSent

public int getNumberOfTheStepForWhichANewsIsSent()
returning the sequential number of the recipe referring to which a news will be sent

getOrderEvaluation

public float getOrderEvaluation()
returning the value of the production already done

setFixedAndVariableOrderCosts

public void setFixedAndVariableOrderCosts(float fc,
                                          float vc)
setting fixed and variable costs for the orders in production or finished

getOrderTotalCosts

public float getOrderTotalCosts()
getting the total of costs of the order

getOrderRecipe

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

getOrderState

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

getPendingProcurementSpecificationSet

public java.lang.Object getPendingProcurementSpecificationSet()
getting the procurement 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 procurement specification set exists for the next step, a null value is returned

getPendingStandAloneBatchSpecificationSet

public java.lang.Object getPendingStandAloneBatchSpecificationSet()
getting the stand alone batch 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 stand alone batch SpecificationSet exists for the next step, a null value is returned

getPendingSequentialBatchSpecificationSet

public java.lang.Object getPendingSequentialBatchSpecificationSet()
getting the sequential batch 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 sequential batch SpecificationSet exists for the next step, a null value is returned

getPendingOrSpecificationSet

public java.lang.Object getPendingOrSpecificationSet()
getting the 'or' 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 'or' SpecificationSet exists for the next step, a null value is returned

setProcuredItemList

public void setProcuredItemList(Order o)
adding an item to the procuredItemList

setMultiplicity

public void setMultiplicity(int m)
set multiplicity factor

getMultiplicity

public int getMultiplicity()
get multiplicity factor

drop

public void drop()
drop the order
Overrides:
drop in class swarm.objectbase.SwarmObjectImpl

checkMethod

public swarm.Selector checkMethod(java.lang.Object obj,
                                  java.lang.String method)

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

getRecipeVector

public int[] getRecipeVector()
getting the order recipe vector address

getStateVector

public int[] getStateVector()
getting the order state vector address

setInSequentialBatch

public void setInSequentialBatch(boolean v)
set inSequentialBatch

getInSequentialBatch

public boolean getInSequentialBatch()
get inSequentialBatch

clone

public java.lang.Object clone()
Cloneable interface method: clone()
Overrides:
clone in class java.lang.Object

arrangeForProcurements

public void arrangeForProcurements()
the internal method dealing with procurements()