net.simplace.sim.io.output.FWSimOutputAdapter
Abstract implementation for the IO-Adapter for only writing output data This
abstract implementation is net.simplace.sim.io.FWSimIOAdapter. It additionally implements
a blocking queue java.util.concurrent.ArrayBlockingQueue that makes it possible to divide
the model output from writing the output to the different interfaces.
Cache size is the number of elements that can be cached in the queue before
the queue will also stop to take elements from the model output.
!!IMPORTANT!! Before finalizing the application it has to be checked, if all
output is written to the net.simplace.sim.io.interfaces.FWSimInterfaces resp. the blocking queue is
empty.
reads general information from the xml-structure given as
public abstract class FWSimOutputAdapter extends
net.simplace.sim.io.FWSimIOAdapter {
// Public Constructors
public FWSimOutputAdapter(String aName, Element aOutputElement,
FWSimInterface aInterface, FWSimIOAdapter.FREQUENCE aFrequence, int
aOrderNumber, String aCacheSize, FWSimSession aSession);
// Protected Constructors
protected FWSimOutputAdapter(Element aOutputElement, int aOrderNumber,
FWSimVarMap aVarMap);
protected FWSimOutputAdapter(FWSimOutputAdapter aOutputAdapter,
FWSimInterface aInterface);
// Protected Instance Variables
protected ArrayBlockingQueue iQueue;
protected int iCacheSize;
// Class Methods
// Public Instance Methods public void
receiveData(
FWSimQueueObjectMap aVarMap);
Outputter should write the data to this method - writing is done
automatically in another thread.
public void writeData();
method called by different thread actually writing the data to the given
media in SimInterface
public Collection getOutputVariables();
always returns empty list. No Output expected from this adapter
public Collection getInputVariables();
returns list of the input variables given as header information
public String getResetScript();
returns the rule
public int getQueueLenth();
returns length of the current queue
public boolean isActive();
returns if the Queue is actively running
public boolean hasStatistics();
returns if the adapter has statistics
public LinkedHashMap getStatisticsHeaderVariables();
returns the statistics header variable
public LinkedList getStatistics();
returns the statistics
public
FWSimResultCache getStatisticsResultCache(String aSimulationID);
returns the statisticsResultCache
public Element toXML();
public String toHTMLTablestring();
creates HTML Documentation form of the Output Adaptor
returns the generated HTMLString
public boolean isWriting();
for synchronization purposes checks, if the writing method is still
active, even if the queue is empty
returns true if the writing process is still active
// Protected Instance Methods protected abstract void
writeData(
FWSimQueueObjectMap aObjectToWrite);
writes data to the interface - has to be implemented for each adapter
individually
- aSimulationID
- aObjectToWrite
}
Hierarchy: java.lang.Object - net.simplace.sim.io.FWSimIOAdapter (net.simplace.sim.util.FWSimFieldContainer) - FWSimOutputAdapter
Extended by: net.simplace.sim.io.output.adapter.CacheOutputAdapter, net.simplace.sim.io.output.adapter.CSVOutputAdapter, net.simplace.sim.io.output.adapter.DatabaseOutputAdapter, net.simplace.sim.io.output.adapter.NetCDFOutputAdapter
Passed to: net.simplace.sim.io.output.adapter.CacheOutputAdapter(), FWSimStatisticVariable.createStatistic(), net.simplace.sim.io.output.adapter.CSVOutputAdapter(), net.simplace.sim.io.output.adapter.DatabaseOutputAdapter(), net.simplace.sim.io.output.statistic.DefaultSimStatistic(), FWSimOutputAdapter(), FWSimStatisticVariable.FWSimStatisticVariable(), net.simplace.sim.io.output.adapter.NetCDFOutputAdapter(), updateAdapter()
Returned by: createAdapter(), createOutputFromObservable(), FWSimOutput.getAdapter(), getStatisticsAdapter(), updateAdapter()
Type of: FWSimOutput.iAdapter