Class ESFrameModelSwarm

java.lang.Object
  extended byswarm.BaseImpl
      extended byswarm.objectbase.SwarmImpl
          extended byESFrameModelSwarm
All Implemented Interfaces:
swarm.activity.ActionType, swarm.activity.ActionTypeS, 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.Swarm, swarm.activity.SwarmProcess, swarm.activity.SwarmProcessS, swarm.objectbase.SwarmS, swarm.activity.SynchronizationType, swarm.activity.SynchronizationTypeS, swarm.defobj.Zone, swarm.defobj.ZoneS

public class ESFrameModelSwarm
extends swarm.objectbase.SwarmImpl

The Model contains the Units

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

Field Summary
 float concludedOrders
          concluded orders form the beginning of the simulation
 float globalProduction
          global production from the beginning of the run
 double increasingVisibilityStep
          increasing visibility in each step 1 of each unit
 double interVisibilityMinLevel
          the min level of inter-visibility; below this level two units cannot exchange products
 int maxInactivity
          max inactivity value
 double maxStartingVisibility
          the max starting visibility
 int maxStepLength
          the max length of a step in a recipe (in units of time)
 int maxStepNumber
           
 int maxUnsentProducts
          max quantity of unsent products
 double minStartingVisibility
          the min starting visibility
 swarm.activity.ActionGroup modelActions2
          ActionGroup for holding an ordered sequence of action (the numbers of the model action names are the same used in the full jES model, so some are lacking in this version)
 swarm.activity.ActionGroup modelActions2b
          ActionGroup for holding an ordered sequence of action (the numbers of the model action names are the same used in the full jES model, so some are lacking in this version)
 swarm.activity.ActionGroup modelActions2generator
          ActionGroup for holding an ordered sequence of action (the numbers of the model action names are the same used in the full jES model, so some are lacking in this version)
 swarm.activity.Schedule modelSchedule
          the Schedule operating in the Model
 swarm.collections.ListShufflerImpl myShuffler
          a shuffler for the list
 double newUnitGenerationP
          probability of unit new Unit generation while the simulation is running
 OrderGenerator orderGenerator
          the order generator
 int potentialUnitNumberPerType
          repetition in unit creation if potentialUnitNumberPerType > 1 each type of unit (as in each row of unitData/unitBasicData.txt) can be be created in multiple copies, always applying unitGenerationInitialP; unit number are unit*100+repetition factor (if potentialUnitNumberPerType > 99 we have nonsense numbers)
 int potentialUnitTypes
          the total number of operating Units we are using
 swarm.collections.ListImpl proFormaUnitList
          the list of the pro forma units (all the "would be" units)
 float totalProductionTime
          the total production time used by done orders
 float totalRecipeLength
          the total length of the recipes of the done orders
 UnitActivitySpace unitActivitySpace
          the unit activity space, always metaphoric
 double unitGenerationInitialP
          the probability of initial generation of a unit, listed into the unit directory
 swarm.collections.ListImpl unitList
          the list of the operating units
 swarm.collections.ListIndex unitListIndex
          its iterator
 UnitParameters unitParameters
          the input class for unit parameters
 swarm.space.Grid2dImpl unitSpace
          the unit space (a metaphorical one)
 int unitSpaceXSize
          the X size of the unit space
 int unitSpaceYSize
          the Y size of the unit space
 
Constructor Summary
ESFrameModelSwarm(swarm.defobj.Zone aZone)
           
 
Method Summary
 swarm.activity.Activity activateIn(swarm.objectbase.Swarm swarmContext)
          Now set up the model's activation. swarmContext indicates where we're being started in - typically, this model is run as a subswarm of an observer swarm.
 void addToConcludedOrders(float d)
          increasing/decreasing the value of the concluded orders
 void addToGlobalProduction(int d)
          increasing/decreasing global production value
 java.lang.Object buildActions()
          Here is where the model schedule is built, the data structures that define the simulation of time in the model.
 java.lang.Object buildObjects()
          Build the model objects.
 void dropUnits()
          dropping units
 void generateANewUnit()
           
 void generateUnit(int i, int rep)
          unit generation
 float getConcludedOrderSteps()
          reporting the value of the concluded orders
 float getGlobalProduction()
          reporting the global production value
 float getNumberOfUnits()
          report the number of units
 float getTimeLengthRatio()
          report the ratio totalProductionTime/totalRecipeLength
 UnitActivitySpace getUnitActivitySpace()
          return the unitActivitySpace address
 java.lang.Object getUnitList()
          the method returns the list of the units
 swarm.space.Grid2dImpl getUnitSpace()
          return the unitSpace
 void setProductionTimeAndRecipeLength(float pt, float rl)
          record total production time and total recipe length
 void shuffleUnitList()
          shuffling the unitList
 
Methods inherited from class swarm.objectbase.SwarmImpl
allocIVars, allocIVarsComponent, compare, copyIVars, copyIVarsComponent, describe, describeForEach, describeForEachID, describeID, drop, freeIVars, freeIVarsComponent, getActivity, getCompleteProbeMap, getComponentZone, getDisplayName, getInternalZone, getName, getPageSize, getPopulation, getProbeForVariable, getProbeMap, getSynchronizationType, 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

potentialUnitTypes

public int potentialUnitTypes
the total number of operating Units we are using


unitGenerationInitialP

public double unitGenerationInitialP
the probability of initial generation of a unit, listed into the unit directory


potentialUnitNumberPerType

public int potentialUnitNumberPerType
repetition in unit creation if potentialUnitNumberPerType > 1 each type of unit (as in each row of unitData/unitBasicData.txt) can be be created in multiple copies, always applying unitGenerationInitialP; unit number are unit*100+repetition factor (if potentialUnitNumberPerType > 99 we have nonsense numbers)


newUnitGenerationP

public double newUnitGenerationP
probability of unit new Unit generation while the simulation is running


maxStepNumber

public int maxStepNumber

maxStepLength

public int maxStepLength
the max length of a step in a recipe (in units of time)


totalProductionTime

public float totalProductionTime
the total production time used by done orders


totalRecipeLength

public float totalRecipeLength
the total length of the recipes of the done orders


unitSpaceXSize

public int unitSpaceXSize
the X size of the unit space


unitSpaceYSize

public int unitSpaceYSize
the Y size of the unit space


unitSpace

public swarm.space.Grid2dImpl unitSpace
the unit space (a metaphorical one)


unitActivitySpace

public UnitActivitySpace unitActivitySpace
the unit activity space, always metaphoric


minStartingVisibility

public double minStartingVisibility
the min starting visibility


maxStartingVisibility

public double maxStartingVisibility
the max starting visibility


interVisibilityMinLevel

public double interVisibilityMinLevel
the min level of inter-visibility; below this level two units cannot exchange products


increasingVisibilityStep

public double increasingVisibilityStep
increasing visibility in each step 1 of each unit


maxInactivity

public int maxInactivity
max inactivity value


maxUnsentProducts

public int maxUnsentProducts
max quantity of unsent products


globalProduction

public float globalProduction
global production from the beginning of the run


concludedOrders

public float concludedOrders
concluded orders form the beginning of the simulation


orderGenerator

public OrderGenerator orderGenerator
the order generator


modelActions2

public swarm.activity.ActionGroup modelActions2
ActionGroup for holding an ordered sequence of action (the numbers of the model action names are the same used in the full jES model, so some are lacking in this version)


modelActions2b

public swarm.activity.ActionGroup modelActions2b
ActionGroup for holding an ordered sequence of action (the numbers of the model action names are the same used in the full jES model, so some are lacking in this version)


modelActions2generator

public swarm.activity.ActionGroup modelActions2generator
ActionGroup for holding an ordered sequence of action (the numbers of the model action names are the same used in the full jES model, so some are lacking in this version)


modelSchedule

public swarm.activity.Schedule modelSchedule
the Schedule operating in the Model


unitParameters

public UnitParameters unitParameters
the input class for unit parameters


unitList

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


unitListIndex

public swarm.collections.ListIndex unitListIndex
its iterator


myShuffler

public swarm.collections.ListShufflerImpl myShuffler
a shuffler for the list


proFormaUnitList

public swarm.collections.ListImpl proFormaUnitList
the list of the pro forma units (all the "would be" units)

Constructor Detail

ESFrameModelSwarm

public ESFrameModelSwarm(swarm.defobj.Zone aZone)
Method Detail

buildObjects

public java.lang.Object buildObjects()
Build the model objects.


buildActions

public java.lang.Object buildActions()
Here is where the model schedule is built, the data structures that define the simulation of time in the model. The core is an actionGroup that has a list of actions. That's then put in a Schedule.


activateIn

public swarm.activity.Activity activateIn(swarm.objectbase.Swarm swarmContext)
Now set up the model's activation. swarmContext indicates where we're being started in - typically, this model is run as a subswarm of an observer swarm.


generateUnit

public void generateUnit(int i,
                         int rep)
unit generation


generateANewUnit

public void generateANewUnit()

getUnitList

public java.lang.Object getUnitList()
the method returns the list of the units


shuffleUnitList

public void shuffleUnitList()
shuffling the unitList


dropUnits

public void dropUnits()
dropping units


setProductionTimeAndRecipeLength

public void setProductionTimeAndRecipeLength(float pt,
                                             float rl)
record total production time and total recipe length


getTimeLengthRatio

public float getTimeLengthRatio()
report the ratio totalProductionTime/totalRecipeLength


getNumberOfUnits

public float getNumberOfUnits()
report the number of units


getUnitSpace

public swarm.space.Grid2dImpl getUnitSpace()
return the unitSpace


addToGlobalProduction

public void addToGlobalProduction(int d)
increasing/decreasing global production value


getGlobalProduction

public float getGlobalProduction()
reporting the global production value


addToConcludedOrders

public void addToConcludedOrders(float d)
increasing/decreasing the value of the concluded orders


getConcludedOrderSteps

public float getConcludedOrderSteps()
reporting the value of the concluded orders


getUnitActivitySpace

public UnitActivitySpace getUnitActivitySpace()
return the unitActivitySpace address