Class UnitParameters

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

This class reads the parameters (costs and prodocution phases) for each unit

Author:
Dario Landini and Nicola Ormezzano; IO improved by Michele Sonnessa
, deeply modified by Pietro Terna to deal with simple or complex units

Field Summary
 int[] endUnitNumber
          the vector of the end unit numbers (which are also its end code)
 float[] fixedCosts
          the vector of the fixed costs (per day or time step) of each unit
 int[] simpleUnitProductionPhase
          the vector of simple unit production phase (simple=with a unique activity)
 int totalEndUnitNumber
           
 int totalUnitNumber
           
 int[] unitNumber
          the vector of the unit numbers
 int[] useWarehouseLocalChoice
          the number of the units (the size of the vectors)
 float[] variableCosts
          the vector of the variable costs (per day or time step) of each unit
 boolean worksheetUnitFileOpen
          check if we are using an Excel like (generated by Office or OpenOffice) file containing special unit data
 
Constructor Summary
UnitParameters(swarm.defobj.Zone aZone, int un, int eun)
          the constructor of UnitParameters
 
Method Summary
 int getEndUnitNumber(int i)
          returning the unit number for a specific endUnit
 float getFixedCosts(int i)
          returning the fixed cost for a specific unit
 int getSimpleUnitProductionPhase(int i)
          returning the production phase for a specific simple unit
 int getUnitNumber(int i)
          returning the unit number for a specific (normal) unit
 int getUseWarehouseLocalChoice(int i)
          returning the local use of the warehouse for a specific unit
 float getVariableCosts(int i)
          returning the variable cost for a specific unit
 void lackingData(java.lang.String s)
          conclude execution if data are lacking
 void readUnitData()
          read
(i) the unit numbers, production phases, fixed costs and variable costs from the unitData/unitBasicData.txt file
(ii) the end unit numbers from the unitData/endUnitList.txt file
 void setParametersTo(int i, Unit aUnit)
          setting the parameters of (normal) units
 void setParametersToEndUnit(int i, EndUnit anEndUnit)
          setting the parameters of end 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

unitNumber

public int[] unitNumber
the vector of the unit numbers


simpleUnitProductionPhase

public int[] simpleUnitProductionPhase
the vector of simple unit production phase (simple=with a unique activity)


fixedCosts

public float[] fixedCosts
the vector of the fixed costs (per day or time step) of each unit


variableCosts

public float[] variableCosts
the vector of the variable costs (per day or time step) of each unit


useWarehouseLocalChoice

public int[] useWarehouseLocalChoice
the number of the units (the size of the vectors)


endUnitNumber

public int[] endUnitNumber
the vector of the end unit numbers (which are also its end code)


totalUnitNumber

public int totalUnitNumber

totalEndUnitNumber

public int totalEndUnitNumber

worksheetUnitFileOpen

public boolean worksheetUnitFileOpen
check if we are using an Excel like (generated by Office or OpenOffice) file containing special unit data

Constructor Detail

UnitParameters

public UnitParameters(swarm.defobj.Zone aZone,
                      int un,
                      int eun)
the constructor of UnitParameters

Method Detail

readUnitData

public void readUnitData()
read
(i) the unit numbers, production phases, fixed costs and variable costs from the unitData/unitBasicData.txt file
(ii) the end unit numbers from the unitData/endUnitList.txt file


setParametersTo

public void setParametersTo(int i,
                            Unit aUnit)
setting the parameters of (normal) units


setParametersToEndUnit

public void setParametersToEndUnit(int i,
                                   EndUnit anEndUnit)
setting the parameters of end units


getUnitNumber

public int getUnitNumber(int i)
returning the unit number for a specific (normal) unit


getEndUnitNumber

public int getEndUnitNumber(int i)
returning the unit number for a specific endUnit


getSimpleUnitProductionPhase

public int getSimpleUnitProductionPhase(int i)
returning the production phase for a specific simple unit


getFixedCosts

public float getFixedCosts(int i)
returning the fixed cost for a specific unit


getVariableCosts

public float getVariableCosts(int i)
returning the variable cost for a specific unit


getUseWarehouseLocalChoice

public int getUseWarehouseLocalChoice(int i)
returning the local use of the warehouse for a specific unit


lackingData

public void lackingData(java.lang.String s)
conclude execution if data are lacking