net.simplace.simulation.io.output.FWSimOutputAdapter
Abstract implementation for the IO-Adapter for only writing output data
This abstract implementation is net.simplace.simulation.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.simulation.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.simulation.io.FWSimIOAdapter {
// Public Constructors
public FWSimOutputAdapter(String aName, Element aResourceElement,
FWSimInterface aInterface, FWSimIOAdapter.FREQUENCE aFrequence, int
aOrderNumber, String aCacheSize);
// 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 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
// 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.simulation.io.FWSimIOAdapter (net.simplace.simulation.util.FWSimFieldContainer) - FWSimOutputAdapter
Extended by: net.simplace.simulation.io.output.adapter.CacheOutputAdapter, net.simplace.simulation.io.output.adapter.CSVOutputAdapter, net.simplace.simulation.io.output.adapter.DatabaseOutputAdapter
Passed to: net.simplace.simulation.io.output.adapter.CacheOutputAdapter(), FWSimStatisticVariable.createStatistic(), net.simplace.simulation.io.output.adapter.CSVOutputAdapter(), net.simplace.simulation.io.output.adapter.DatabaseOutputAdapter(), net.simplace.simulation.io.output.statistic.DefaultSimStatistic(), FWSimOutputAdapter(), FWSimStatisticVariable.FWSimStatisticVariable(), updateAdapter()
Returned by: createAdapter(), createOutputFromObservable(), FWSimOutput.getAdapter(), getStatisticsAdapter(), updateAdapter()
Type of: FWSimOutput.iAdapter