Class AssigningTool

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

A tool to choose the unit to which we have to send an order

Author:
Pietro Terna

Field Summary
 Unit aUnit
          the temporary address of an existing unit
 double interVisibilityMinLevel
          the min level of inter-visibility; below this level two units cannot exchange products; this value is not used in assignment coming from OrderGenerator; this value can be different from one model to another: that of the sending unit is used
 swarm.collections.ListShufflerImpl myShuffler
          a shuffler for the list
 swarm.collections.ListImpl myUnitList
          copy of the unit list, to be locally shuffled
 swarm.collections.ListIndex myUnitListIndex
          the iterator of myUnitList
 boolean shuffleListsAtEachAssignment
          shuffle the lists at each assignment
 int stratum
          the numner of our stratum and the number of strata (or different models) in this run
 int stratumNumber
          the numner of our stratum and the number of strata (or different models) in this run
 UnitActivitySpace unitActivitySpace
          the activity space of the first unit
 swarm.collections.ListImpl unitList
          the list of the normal units existing in our environment
 swarm.collections.ListIndex unitListIndex
          the iterator of unitList
 
Constructor Summary
AssigningTool(swarm.defobj.Zone aZone, int straN, int stra, boolean sl)
          the constructor
 
Method Summary
 Order assign(Order firstOrder)
          assignment from the order generator or the order distiller
 Order assign(Unit sendingUnit, Order firstOrder)
          assignment between two units
 
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

unitList

public swarm.collections.ListImpl unitList
the list of the normal units existing in our environment


unitListIndex

public swarm.collections.ListIndex unitListIndex
the iterator of unitList


aUnit

public Unit aUnit
the temporary address of an existing unit


unitActivitySpace

public UnitActivitySpace unitActivitySpace
the activity space of the first unit


interVisibilityMinLevel

public double interVisibilityMinLevel
the min level of inter-visibility; below this level two units cannot exchange products; this value is not used in assignment coming from OrderGenerator; this value can be different from one model to another: that of the sending unit is used


shuffleListsAtEachAssignment

public boolean shuffleListsAtEachAssignment
shuffle the lists at each assignment


myUnitList

public swarm.collections.ListImpl myUnitList
copy of the unit list, to be locally shuffled


myUnitListIndex

public swarm.collections.ListIndex myUnitListIndex
the iterator of myUnitList


myShuffler

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


stratum

public int stratum
the numner of our stratum and the number of strata (or different models) in this run


stratumNumber

public int stratumNumber
the numner of our stratum and the number of strata (or different models) in this run

Constructor Detail

AssigningTool

public AssigningTool(swarm.defobj.Zone aZone,
                     int straN,
                     int stra,
                     boolean sl)
the constructor

Method Detail

assign

public Order assign(Unit sendingUnit,
                    Order firstOrder)
assignment between two units


assign

public Order assign(Order firstOrder)
assignment from the order generator or the order distiller