Class Unit

java.lang.Object
  extended byswarm.BaseImpl
      extended byswarm.objectbase.SwarmObjectImpl
          extended byUnit
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 Unit
extends swarm.objectbase.SwarmObjectImpl

The Unit class instances are micro unit in our virtual enterprise; i.e. the units where the steps required to build a product (to fulfill an order) are done

Author:
Pietro Terna (with Marco Remondino, Dario Landini, Nicola Ormezzano and Paolo Pelligra contributions)

Field Summary
 Unit aUnit
          the temporary address of an existing unit
 swarm.collections.ListImpl dailyProductionList
          the list containing the orders (if any) performed in a day
 Order firstOrder
          the first order to be executed
 int unitNumber
          the number identifying the unit
 int unitProductionPhase
          the unit production phase
 swarm.collections.ListImpl waitingList
          the list of the orders to be executed
 
Constructor Summary
Unit(swarm.defobj.Zone aZone, ESFrameModelSwarm mo, AssigningTool at)
          the constructor for Unit
 
Method Summary
 int getProductionPhase()
          return the production phases of the unit
 int getUnitNumber()
          get unit number
 void setProductionPhase(int ph)
          set unit production phases
 void setUnitNumber(int un)
          set unit number
 void setWaitingList(Order anOrder)
          Putting an order in the production waitingList of the unit (using a related object if any)
 void unitStep1()
          production:

at the beginning of each time tick in the 'day', each unit looks for the order(s) (if any) to be executed; the production cycle is 'one unit of time' in a step of the recipe of an order in a tick of a day;

 void unitStep2()
          diffusion and accounting:

sending the orders to the subsequent production units;

making accounting operations
 
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

unitNumber

public int unitNumber
the number identifying the unit


unitProductionPhase

public int unitProductionPhase
the unit production phase


waitingList

public swarm.collections.ListImpl waitingList
the list of the orders to be executed


dailyProductionList

public swarm.collections.ListImpl dailyProductionList
the list containing the orders (if any) performed in a day


aUnit

public Unit aUnit
the temporary address of an existing unit


firstOrder

public Order firstOrder
the first order to be executed

Constructor Detail

Unit

public Unit(swarm.defobj.Zone aZone,
            ESFrameModelSwarm mo,
            AssigningTool at)
the constructor for Unit

Method Detail

setUnitNumber

public void setUnitNumber(int un)
set unit number


getUnitNumber

public int getUnitNumber()
get unit number


unitStep1

public void unitStep1()
production:

at the beginning of each time tick in the 'day', each unit looks for the order(s) (if any) to be executed; the production cycle is 'one unit of time' in a step of the recipe of an order in a tick of a day;


unitStep2

public void unitStep2()
diffusion and accounting:

sending the orders to the subsequent production units;

making accounting operations


setProductionPhase

public void setProductionPhase(int ph)
set unit production phases


getProductionPhase

public int getProductionPhase()
return the production phases of the unit


setWaitingList

public void setWaitingList(Order anOrder)
Putting an order in the production waitingList of the unit (using a related object if any)