Class OrderDistiller

java.lang.Object
  |
  +--swarm.BaseImpl
        |
        +--swarm.objectbase.SwarmObjectImpl
              |
              +--OrderGenerator
                    |
                    +--OrderDistiller
All Implemented Interfaces:
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 OrderDistiller
extends OrderGenerator

This class is used to read data from two worksheets.
The first one contains the list of recipes of our virtual enterprise.
The second one contains a sequence of orders to be launched, shift by shift, in order to make the daily production activities.


Field Summary
 Order anOrder
          a specific order
 java.lang.String backslash
          Flags to operate checks while reading
 java.lang.String checkTheCell
          Flags to operate checks while reading
 java.lang.String computation
          Flags to operate checks while reading
 java.lang.String end
          Flags to operate checks while reading
 swarm.collections.ListImpl endUnitList
          the list containig the end units
static boolean firstTime
           
 java.lang.String gate
          Flags to operate checks while reading
 java.lang.String layer
          Flags to operate checks while reading
 java.lang.String min
          Flags to operate checks while reading
 java.lang.String or
          Flags to operate checks while reading
 int orderCount
          used to record the number of generated orders
 swarm.collections.ListImpl orderList
          the list containig all the orders
 java.lang.String p
          Flags to operate checks while reading
 swarm.collections.ListImpl recipeList
          the list containig all the orders
 java.lang.String sec
          Flags to operate checks while reading
 java.lang.String semicolon
          Flags to operate checks while reading
 java.lang.String slash
          Flags to operate checks while reading
 swarm.collections.ListImpl unitList
          the list containig the operating units
 boolean worksheetOrderSequenceFileOpen
          INSTANCE VARIABLES A flag to check if the orderSequence worksheet file is open
 boolean worksheetRecipeFileOpen
          INSTANCE VARIABLES A flag to check if the orderSequence worksheet file is open
 
Fields inherited from class OrderGenerator
dictionary, dictionaryLength, layerNumber, maxStepLength, maxStepNumber, orderRecipe1, orderRecipe2, orderRecipeTmp, stepLengthInOrder, totalLayerNumber, use0or1
 
Constructor Summary
OrderDistiller(swarm.defobj.Zone aZone, int msn, int msl, swarm.collections.ListImpl ul, swarm.collections.ListImpl eul, swarm.collections.ListImpl ol, int tln, ESFrameModelSwarm mo, AssigningTool at)
           
 
Method Summary
 void calculateLength(java.lang.String cTC)
          This method is used to calculate the length of each row after a strong check of the elements
 void checkForComments(java.lang.String cTC)
          This method is used to check if there are comments in the cells
 void checkForLayer(ExcelReader e)
          This method is used to check the presence of a new layer
 int checkTheExistence(int c)
          This method is used to check the corrispondence with the dictionary of production phases
 void computation(ExcelReader e)
          This method dial with the computational choice
 void distill()
          This is the method containing the iterator needed to launch the daily production of recipes.
 void end(ExcelReader e)
          This method dial with the end choice
 int errorIsNotAnInteger(ExcelReader e)
          This method is used to check if a type error occurs
 void errorIsNotAString(ExcelReader e)
          This method is used to check if a type error occurs
 int getOrderSequence1(int j)
          This method is used to obtain the elements of the orderSequence1 array
 int getOrderSequence2(int j)
          This method is used to obtain the elements of the orderSequence2 array
 int getOrderSequence3(int j)
          This method is used to obtain the elements of the orderSequence3 array
 void minute(ExcelReader e)
           
 void number(ExcelReader e)
          This method dial with normal or batch choice
 void oR(ExcelReader e)
          This method dial with the or choice
 void procurement(ExcelReader e)
          This method dial with the procurement choice
 void readOrderSequence()
          This method reads from the worksheet containing, shift by shift, the sequence of orders to be launched and fills in the orderSequence1 with the ID codes of recipes and the orderSequence2 with the quantities of each recipe.
 void readRecipes()
          This is the method needed to read and store the recipes.
 void second(ExcelReader e)
           
 void setDictionary()
          This method is used to collect the names of the units and of the end units, so that it can operate the check of corrispondency between the production phases required by recipes and the phases of production the units can do.
 void setRecipeContainers()
          This method is used to set the length of each recipe
 
Methods inherited from class OrderGenerator
createRandomOrderWithNSteps
 
Methods inherited from class swarm.objectbase.SwarmObjectImpl
compare, describe, describeID, drop, 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

worksheetOrderSequenceFileOpen

public boolean worksheetOrderSequenceFileOpen
INSTANCE VARIABLES A flag to check if the orderSequence worksheet file is open


worksheetRecipeFileOpen

public boolean worksheetRecipeFileOpen
INSTANCE VARIABLES A flag to check if the orderSequence worksheet file is open


semicolon

public java.lang.String semicolon
Flags to operate checks while reading


checkTheCell

public java.lang.String checkTheCell
Flags to operate checks while reading


gate

public java.lang.String gate
Flags to operate checks while reading


p

public java.lang.String p
Flags to operate checks while reading


sec

public java.lang.String sec
Flags to operate checks while reading


min

public java.lang.String min
Flags to operate checks while reading


end

public java.lang.String end
Flags to operate checks while reading


slash

public java.lang.String slash
Flags to operate checks while reading


backslash

public java.lang.String backslash
Flags to operate checks while reading


or

public java.lang.String or
Flags to operate checks while reading


layer

public java.lang.String layer
Flags to operate checks while reading


computation

public java.lang.String computation
Flags to operate checks while reading


orderCount

public int orderCount
used to record the number of generated orders


firstTime

public static boolean firstTime

anOrder

public Order anOrder
a specific order


unitList

public swarm.collections.ListImpl unitList
the list containig the operating units


endUnitList

public swarm.collections.ListImpl endUnitList
the list containig the end units


orderList

public swarm.collections.ListImpl orderList
the list containig all the orders


recipeList

public swarm.collections.ListImpl recipeList
the list containig all the orders

Constructor Detail

OrderDistiller

public OrderDistiller(swarm.defobj.Zone aZone,
                      int msn,
                      int msl,
                      swarm.collections.ListImpl ul,
                      swarm.collections.ListImpl eul,
                      swarm.collections.ListImpl ol,
                      int tln,
                      ESFrameModelSwarm mo,
                      AssigningTool at)
Method Detail

setDictionary

public void setDictionary()
This method is used to collect the names of the units and of the end units, so that it can operate the check of corrispondency between the production phases required by recipes and the phases of production the units can do.

Overrides:
setDictionary in class OrderGenerator

setRecipeContainers

public void setRecipeContainers()
This method is used to set the length of each recipe


readRecipes

public void readRecipes()
This is the method needed to read and store the recipes. The procedure follows this steps:
It opens the worksheet file recipes.xls, in which are stored the sequence of steps of all the recipes;
It makes some check of the routines;
It search the object containig the same code of the recipe we are considering;
Finally it substitutes the values of the array of that object with the new ones.


calculateLength

public void calculateLength(java.lang.String cTC)
This method is used to calculate the length of each row after a strong check of the elements


computation

public void computation(ExcelReader e)
This method dial with the computational choice


procurement

public void procurement(ExcelReader e)
This method dial with the procurement choice


oR

public void oR(ExcelReader e)
This method dial with the or choice


end

public void end(ExcelReader e)
This method dial with the end choice


number

public void number(ExcelReader e)
This method dial with normal or batch choice


second

public void second(ExcelReader e)

minute

public void minute(ExcelReader e)

distill

public void distill()
This is the method containing the iterator needed to launch the daily production of recipes. It take a look at the orderSequence arrays to determine which recipes must be done and how many times. A request for which unit can do the first production phase of each recipe will be done to units or endUnits.


readOrderSequence

public void readOrderSequence()
This method reads from the worksheet containing, shift by shift, the sequence of orders to be launched and fills in the orderSequence1 with the ID codes of recipes and the orderSequence2 with the quantities of each recipe.


checkTheExistence

public int checkTheExistence(int c)
This method is used to check the corrispondence with the dictionary of production phases


checkForLayer

public void checkForLayer(ExcelReader e)
This method is used to check the presence of a new layer


checkForComments

public void checkForComments(java.lang.String cTC)
This method is used to check if there are comments in the cells


errorIsNotAnInteger

public int errorIsNotAnInteger(ExcelReader e)
This method is used to check if a type error occurs


errorIsNotAString

public void errorIsNotAString(ExcelReader e)
This method is used to check if a type error occurs


getOrderSequence1

public int getOrderSequence1(int j)
This method is used to obtain the elements of the orderSequence1 array


getOrderSequence2

public int getOrderSequence2(int j)
This method is used to obtain the elements of the orderSequence2 array


getOrderSequence3

public int getOrderSequence3(int j)
This method is used to obtain the elements of the orderSequence3 array