public class TakeoverCellOutputter extends TableOutputter<TakeoverCellOutputter.RegionPotentialAgent> implements GloballyInitialisable, TakeoverObserver
AllocationModels that implement
TakeoverMessenger. This is useful since the component that knows about take-overs is an
exchangeable component and this way not every AllocationModel is required to implement
the service. Furthermore, this way take-overs only need to be reported in case there is a
TakeoverObserver registered.
NOTE: There is one instance of TakeoverCellOutputter that handles all regions, even if
perRegion == true.
NOTE: If perRegion == false there are columns for each AFT per region, even if
regions share the same set of AFTs.
NOTE: Assumes that AFT IDs do not leave out any number (i.e. max(AFT-ID) == length(AFTs))| Modifier and Type | Class and Description |
|---|---|
class |
TakeoverCellOutputter.RegionPotentialAgent |
class |
TakeoverCellOutputter.TakeOverAftColumn |
class |
TakeoverCellOutputter.TakeOverColumn |
TableOutputter.RegionsColumn<T>, TableOutputter.TickColumn<T>disabled, endYear, everyNYears, log, modelData, outputs, persister, runInfo, startYear| Constructor and Description |
|---|
TakeoverCellOutputter() |
| Modifier and Type | Method and Description |
|---|---|
Iterable<TakeoverCellOutputter.RegionPotentialAgent> |
getData(Regions r) |
String |
getDefaultOutputName() |
void |
initialise(ModelData data,
RunInfo info,
Regions regions) |
void |
initTakeOvers(Region region)
To be called before the first output.
|
void |
setOutputManager(Outputs outputs) |
void |
setTakeover(Region region,
Agent previousAgent,
Agent newAgent) |
void |
startFile(String filename,
Regions regions) |
void |
writeData(Iterable<TakeoverCellOutputter.RegionPotentialAgent> data,
Regions r) |
addColumn, close, doOutput, endFile, filePerTick, writeFiledisable, filename, getEndYear, getEveryNYears, getExtension, getOutputName, getStartYear, initialise, open, setOutputName, tickFilenamepublic void initialise(ModelData data, RunInfo info, Regions regions) throws Exception
initialise in interface GloballyInitialisabledata - model datainfo - run informationExceptionGloballyInitialisable.initialise(org.volante.abm.data.ModelData,
org.volante.abm.schedule.RunInfo, org.volante.abm.data.Regions)public void startFile(String filename, Regions regions) throws IOException
startFile in class TableOutputter<TakeoverCellOutputter.RegionPotentialAgent>IOExceptionpublic void setOutputManager(Outputs outputs)
setOutputManager in interface OutputtersetOutputManager in class AbstractOutputterAbstractOutputter.setOutputManager(org.volante.abm.output.Outputs)public void initTakeOvers(Region region)
TakeoverObserverinitTakeOvers in interface TakeoverObserverpublic void setTakeover(Region region, Agent previousAgent, Agent newAgent)
setTakeover in interface TakeoverObserverTakeoverObserver.setTakeover(org.volante.abm.data.Region,
org.volante.abm.agent.Agent, org.volante.abm.agent.Agent)public Iterable<TakeoverCellOutputter.RegionPotentialAgent> getData(Regions r)
getData in class TableOutputter<TakeoverCellOutputter.RegionPotentialAgent>TableOutputter.getData(org.volante.abm.data.Regions)public String getDefaultOutputName()
getDefaultOutputName in class AbstractOutputterAbstractOutputter.getDefaultOutputName()public void writeData(Iterable<TakeoverCellOutputter.RegionPotentialAgent> data, Regions r) throws IOException
writeData in class TableOutputter<TakeoverCellOutputter.RegionPotentialAgent>IOExceptionTableOutputter.writeData(java.lang.Iterable,
org.volante.abm.data.Regions)