Class ESFrameObserverSwarm

java.lang.Object
  extended byswarm.BaseImpl
      extended byswarm.simtoolsgui.GUISwarmImpl
          extended byESFrameObserverSwarm
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.simtoolsgui.GUISwarm, swarm.simtoolsgui.GUISwarmS, swarm.objectbase.Swarm, swarm.activity.SwarmProcess, swarm.activity.SwarmProcessS, swarm.objectbase.SwarmS, swarm.activity.SynchronizationType, swarm.activity.SynchronizationTypeS, swarm.simtoolsgui.WindowGeometryRecordName, swarm.simtoolsgui.WindowGeometryRecordNameS, swarm.defobj.Zone, swarm.defobj.ZoneS

public class ESFrameObserverSwarm
extends swarm.simtoolsgui.GUISwarmImpl

The Observer contains the Model and the graphic widgets

Author:
Pietro Terna and several of his students

Field Summary
 boolean checkMemorySize
          displaying memory information on the console
 swarm.activity.ActionGroup displayActions1
          two ActionGroup for sequence of GUI events
 swarm.activity.ActionGroup displayActions2
          two ActionGroup for sequence of GUI events
 int displayFrequency
          update frequency
 swarm.activity.Schedule displaySchedule
          the single Schedule instance
 ESFrameModelSwarm eSFrameModelSwarm
           
 swarm.collections.ArrayImpl eSFrameModelSwarmArray
          the Swarm we are observing
 int ln
           
 int lnn
           
 swarm.analysis.EZGraphImpl numberOfUnitsGraph
           
 swarm.collections.ArrayImpl numberOfUnitsGraphArray
           
 boolean printMatrixes
          activating the print function in MemoryMatrix class
 swarm.analysis.EZGraphImpl productionGraph
           
 swarm.collections.ArrayImpl productionGraphArray
           
 float ratio1
           
 float ratio2
           
 float ratio3
           
 swarm.analysis.EZGraphImpl ratioGraph
           
 swarm.collections.ArrayImpl ratioGraphArray
           
 int stratumNumber
          the number of strata in our global model; each stratum is a model
 int time
          the time
 int timeToFinish
          the time at which we stop the simulation (if !
 swarm.space.Value2dDisplay unitActivityDisplay
           
 swarm.collections.ArrayImpl unitActivityDisplayArray
           
 swarm.space.Object2dDisplay unitDisplay
           
 swarm.collections.ArrayImpl unitDisplayArray
           
 swarm.gui.ZoomRaster unitRaster
           
 swarm.collections.ArrayImpl unitRasterArray
          our graphics
 boolean verboseChoice
          displaying all messages on the console
 int zoomFactor
           
 
Fields inherited from class swarm.simtoolsgui.GUISwarmImpl
actionCache, controlPanel
 
Constructor Summary
ESFrameObserverSwarm(swarm.defobj.Zone aZone)
          Constructor for class
 
Method Summary
 java.lang.Object _unitRasterDeath_(java.lang.Object caller)
          handling the raster
 swarm.activity.Activity activateIn(swarm.objectbase.Swarm swarmContext)
          activateIn: - activate the schedules so they're ready to run.
 java.lang.Object buildActions()
          Create the actions necessary for the simulation.
 java.lang.Object buildObjects()
          Create the objects used to display the model.
 void checkMemorySize()
          print the memory usage information
 void drop()
          drop the Observer, but after having dropped the EZGraph
 void evaluateRatios()
          evaluating ratio1, ratio2, ratio3 for model in stratum 'ln'
 void finish()
          to finish automatically, if timeToFinish!
 MemoryMatrix getMemoryMatrix(int matrixNumber)
          return the address of a memory matrix as actually set in stratum 0 model
 float getRatio1()
          returning ratio1 (global / potential production)
 float getRatio2()
          returning ratio2 (global / potential production)
 float getRatio3()
          returning ratio3 (final / global production)
 int getTotalMemoryMatrixNumber()
          returning the number of memory matrixes as actually set in stratum 0 model
 void printMemoryMatrixNumber(int matrixNumber)
          print the content of the memory matrix set in stratum 0 model
 void setTime()
          setting the time of the simulation
 
Methods inherited from class swarm.simtoolsgui.GUISwarmImpl
allocIVars, allocIVarsComponent, compare, copyIVars, copyIVarsComponent, describe, describeForEach, describeForEachID, describeID, freeIVars, freeIVarsComponent, getActionCache, getActivity, getCompleteProbeMap, getComponentZone, getControlPanel, getDisplayName, getInternalZone, getName, getPageSize, getPopulation, getProbeForVariable, getProbeMap, getSynchronizationType, getTypeName, getZone, go, 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

stratumNumber

public int stratumNumber
the number of strata in our global model; each stratum is a model


displayFrequency

public int displayFrequency
update frequency


time

public int time
the time


timeToFinish

public int timeToFinish
the time at which we stop the simulation (if != 0)


verboseChoice

public boolean verboseChoice
displaying all messages on the console


printMatrixes

public boolean printMatrixes
activating the print function in MemoryMatrix class


checkMemorySize

public boolean checkMemorySize
displaying memory information on the console


displayActions1

public swarm.activity.ActionGroup displayActions1
two ActionGroup for sequence of GUI events


displayActions2

public swarm.activity.ActionGroup displayActions2
two ActionGroup for sequence of GUI events


displaySchedule

public swarm.activity.Schedule displaySchedule
the single Schedule instance


eSFrameModelSwarmArray

public swarm.collections.ArrayImpl eSFrameModelSwarmArray
the Swarm we are observing


eSFrameModelSwarm

public ESFrameModelSwarm eSFrameModelSwarm

unitRasterArray

public swarm.collections.ArrayImpl unitRasterArray
our graphics


unitDisplayArray

public swarm.collections.ArrayImpl unitDisplayArray

unitActivityDisplayArray

public swarm.collections.ArrayImpl unitActivityDisplayArray

numberOfUnitsGraphArray

public swarm.collections.ArrayImpl numberOfUnitsGraphArray

productionGraphArray

public swarm.collections.ArrayImpl productionGraphArray

ratioGraphArray

public swarm.collections.ArrayImpl ratioGraphArray

numberOfUnitsGraph

public swarm.analysis.EZGraphImpl numberOfUnitsGraph

productionGraph

public swarm.analysis.EZGraphImpl productionGraph

ratioGraph

public swarm.analysis.EZGraphImpl ratioGraph

ratio1

public float ratio1

ratio2

public float ratio2

ratio3

public float ratio3

unitRaster

public swarm.gui.ZoomRaster unitRaster

unitDisplay

public swarm.space.Object2dDisplay unitDisplay

zoomFactor

public int zoomFactor

unitActivityDisplay

public swarm.space.Value2dDisplay unitActivityDisplay

ln

public int ln

lnn

public int lnn
Constructor Detail

ESFrameObserverSwarm

public ESFrameObserverSwarm(swarm.defobj.Zone aZone)
Constructor for class

Method Detail

buildObjects

public java.lang.Object buildObjects()
Create the objects used to display the model.


buildActions

public java.lang.Object buildActions()
Create the actions necessary for the simulation. This is where the schedule is built (but not run!) Here we create a display schedule - this is used to display the state of the world and check for user input.


activateIn

public swarm.activity.Activity activateIn(swarm.objectbase.Swarm swarmContext)
activateIn: - activate the schedules so they're ready to run. The swarmContext argument has to do with what we were activated in*. Typically the ObserverSwarm is the top-stratum Swarm, so it's activated in "null". But other Swarms and Schedules and such will be activated inside of us.


drop

public void drop()
drop the Observer, but after having dropped the EZGraph


checkMemorySize

public void checkMemorySize()
print the memory usage information


finish

public void finish()
to finish automatically, if timeToFinish!=0


_unitRasterDeath_

public java.lang.Object _unitRasterDeath_(java.lang.Object caller)
handling the raster


evaluateRatios

public void evaluateRatios()
evaluating ratio1, ratio2, ratio3 for model in stratum 'ln'


getRatio1

public float getRatio1()
returning ratio1 (global / potential production)


getRatio2

public float getRatio2()
returning ratio2 (global / potential production)


getRatio3

public float getRatio3()
returning ratio3 (final / global production)


setTime

public void setTime()
setting the time of the simulation


getTotalMemoryMatrixNumber

public int getTotalMemoryMatrixNumber()
returning the number of memory matrixes as actually set in stratum 0 model


getMemoryMatrix

public MemoryMatrix getMemoryMatrix(int matrixNumber)
return the address of a memory matrix as actually set in stratum 0 model


printMemoryMatrixNumber

public void printMemoryMatrixNumber(int matrixNumber)
print the content of the memory matrix set in stratum 0 model