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 inactivity
          the number of tick of inactivity
 double increasingVisibilityStep
          increasing visibility in each step 1
 UnitActivitySpace unitActivitySpace
          the unitActivitySpace
 byte unitColor
          position of the unit into the display
 int unitNumber
          the number identifying the unit
 int unitProductionPhase
          the unit production phase
 int unsentProducts
          unsent product at the end of step2
 swarm.collections.ListImpl usableWaitingList
          the list of the orders in the waitingList, not kept into a parallel unit, such as a myComputationalAssembler
 double visibility
          our visibility
 swarm.collections.ListImpl waitingList
          the list of the orders to be executed
 int xPos
          position of the unit into the display
 int yPos
          position of the unit into the display
 
Constructor Summary
Unit(swarm.defobj.Zone aZone, ESFrameModelSwarm mo, UnitActivitySpace uas, AssigningTool at, int x, int y, byte col, double vis, double visStep, ComputationalAssembler ca)
          the constructor for Unit
 
Method Summary
 java.lang.Object drawSelfOn(swarm.gui.Raster r)
          designing itself on the raster
 swarm.collections.ListImpl getDailyProductionList()
          get daily production list
 int getInactivity()
          the inactivity
 int getProductionPhase()
          return the production phases of the unit
 java.lang.Object getUnitModel()
          getting the model the unit belongs to
 int getUnitNumber()
          get unit number
 int getUnsentProducts()
          unsent products at the end of step 2
 int getVisibility()
          the visibility
 swarm.collections.ListImpl getWaitingList()
          get waiting list
 int getWaitingListLength()
          the length of the wainting list
 int getXPos()
          the X position
 int getYPos()
          the Y position
 void setProductionPhase(int ph)
          set unit production phases
 void setUnitNumber(int un)
          set unit number
 void setUsableWaitingList()
          copying the orders in the waitingList, if they are not kept into any parallel unit, such as (in jESOF) myComputationalAssembler
 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


usableWaitingList

public swarm.collections.ListImpl usableWaitingList
the list of the orders in the waitingList, not kept into a parallel unit, such as a myComputationalAssembler


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


xPos

public int xPos
position of the unit into the display


yPos

public int yPos
position of the unit into the display


unitColor

public byte unitColor
position of the unit into the display


unitActivitySpace

public UnitActivitySpace unitActivitySpace
the unitActivitySpace


visibility

public double visibility
our visibility


increasingVisibilityStep

public double increasingVisibilityStep
increasing visibility in each step 1


inactivity

public int inactivity
the number of tick of inactivity


unsentProducts

public int unsentProducts
unsent product at the end of step2

Constructor Detail

Unit

public Unit(swarm.defobj.Zone aZone,
            ESFrameModelSwarm mo,
            UnitActivitySpace uas,
            AssigningTool at,
            int x,
            int y,
            byte col,
            double vis,
            double visStep,
            ComputationalAssembler ca)
the constructor for Unit

Method Detail

setUnitNumber

public void setUnitNumber(int un)
set unit number


getUnitNumber

public int getUnitNumber()
get unit number


setUsableWaitingList

public void setUsableWaitingList()
copying the orders in the waitingList, if they are not kept into any parallel unit, such as (in jESOF) myComputationalAssembler


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)


getVisibility

public int getVisibility()
the visibility


getInactivity

public int getInactivity()
the inactivity


getXPos

public int getXPos()
the X position


getYPos

public int getYPos()
the Y position


getWaitingListLength

public int getWaitingListLength()
the length of the wainting list


getUnsentProducts

public int getUnsentProducts()
unsent products at the end of step 2


getDailyProductionList

public swarm.collections.ListImpl getDailyProductionList()
get daily production list


getWaitingList

public swarm.collections.ListImpl getWaitingList()
get waiting list


drawSelfOn

public java.lang.Object drawSelfOn(swarm.gui.Raster r)
designing itself on the raster


getUnitModel

public java.lang.Object getUnitModel()
getting the model the unit belongs to