Class InventoryRuleMaster

java.lang.Object
  |
  +--swarm.BaseImpl
        |
        +--swarm.objectbase.SwarmObjectImpl
              |
              +--InventoryRuleMaster
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 InventoryRuleMaster
extends swarm.objectbase.SwarmObjectImpl

The InventoryRuleMaster is used to make decisions about inventories.

Author:
Marco Remondino and Pietro Terna, with Paolo Pelligra

Field Summary
 int maxInWarehouses
          the max quantity to be kept in the warehouse (only integer values at present)
 int minInWarehouses
          the min quantity to be kept in the warehouse (only integer values at present)
 swarm.collections.ListImpl newsList
          the news list
 int nOfNewsesToBeCleared
          the number of newses to be cleared after the decision of producing to increase inventories (a simple solution is to have it equal to nOfNewsesToProduce)
 int nOfNewsesToProduce
          the number of newses necessary to decide the productio of inventories
 Warehouse theUnitWarehouse
          the warehouse of the unit which is calling us
 News toBeClearedNews
          a news not yet cleared by the InventoryRuleMaster
 int unitNumber
          the number of the unit which is calling us
 
Constructor Summary
InventoryRuleMaster(swarm.defobj.Zone aZone, int max, int min, int nop, int noc)
          constructor for InventoryRuleMaster
 
Method Summary
 boolean increaseInventories(int un, Warehouse aw)
          the unit which is calling us is idle and it is asking us if it has to produce or not, to increase inventories
 boolean increaseInventoriesUsingNewses(int un, Warehouse aw, swarm.collections.ListImpl nl)
          the unit which is calling us uses newses, is idle and it is asking us if it has to produce or not to increase inventories; we check the newses not yet cleared and we clear them we agree to the production of inventories if the warehouse level is < maxInWarehouses && (we have a news signalling and incoming production step || the warehouse level is < minInWarehouses)
 
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 of the unit which is calling us

maxInWarehouses

public int maxInWarehouses
the max quantity to be kept in the warehouse (only integer values at present)

minInWarehouses

public int minInWarehouses
the min quantity to be kept in the warehouse (only integer values at present)

theUnitWarehouse

public Warehouse theUnitWarehouse
the warehouse of the unit which is calling us

nOfNewsesToProduce

public int nOfNewsesToProduce
the number of newses necessary to decide the productio of inventories

nOfNewsesToBeCleared

public int nOfNewsesToBeCleared
the number of newses to be cleared after the decision of producing to increase inventories (a simple solution is to have it equal to nOfNewsesToProduce)

newsList

public swarm.collections.ListImpl newsList
the news list

toBeClearedNews

public News toBeClearedNews
a news not yet cleared by the InventoryRuleMaster
Constructor Detail

InventoryRuleMaster

public InventoryRuleMaster(swarm.defobj.Zone aZone,
                           int max,
                           int min,
                           int nop,
                           int noc)
constructor for InventoryRuleMaster
Method Detail

increaseInventories

public boolean increaseInventories(int un,
                                   Warehouse aw)
the unit which is calling us is idle and it is asking us if it has to produce or not, to increase inventories

increaseInventoriesUsingNewses

public boolean increaseInventoriesUsingNewses(int un,
                                              Warehouse aw,
                                              swarm.collections.ListImpl nl)
the unit which is calling us uses newses, is idle and it is asking us if it has to produce or not to increase inventories; we check the newses not yet cleared and we clear them we agree to the production of inventories if the warehouse level is < maxInWarehouses && (we have a news signalling and incoming production step || the warehouse level is < minInWarehouses)