net.simplace.sim.components.util.ValueToTableConverter

Creates an table from two scalar values.

Motivation

Some FST-based modules like Lintul5 need irrigation and fertilizer as interpolation tables, where x-values hold the DOY and y-values hold the amount.

When the DOY is not known beforehand, the interpolation table has to be created at simulation runtime.

Configuration, inputs

The sim component takes daily inputs iXValue and iYValue and outputs both as a DOUBLEARRAY ValueTable , first array element holding iXValue, second holding yValue.

iXValue iYValue

If cInterpolationType is set to true, then the output ValueTable has six elements:

iXValue - cDeltaX 0 iXValue iYValue iXValue + cDeltaX 0

If cOnlyY is set to true, then the output ValueTable has only one element

iYValue

In this case, you can use the module to pass DOUBLE values from one component / resource to a component that expects an DOUBLEARRAY. For each of such a conversion, you need an instance of this sim component in your solution.

Component Variables

Content TypeNameDescriptionData TypeUnitMin ValueMax ValueDefault Value
constantcDeltaXdistance of 0-valued points to xDOUBLE--1.0
constantcInterpolationTypeif y-values at x-cDeltaX and x+cDeltaY should be set to 0. BOOLEAN--false
constantcOnlyYOutput y-value only as an array with one elementBOOLEAN--false
inputiXValuex value, not required, if cOnlyY is set to trueDOUBLE--0.0
inputiYValuey value, is always requiredDOUBLE--0.0
outValueTableArray with x and y values, possibly with 0 before and after xDOUBLEARRAY-- 0.0 0.0


See also: FSTFunctions




public class ValueToTableConverter extends net.simplace.sim.model.FWSimComponent {
// Public Constructors
public ValueToTableConverter();


// Public Instance Methods
public HashMap createVariables(); // Defines
net.simplace.sim.model.FWSimComponent


Create the FWSimVariables as interface for this SimComponent

// Protected Instance Methods
protected void init(); // Defines net.simplace.sim.model.FWSimComponent

Initializes the fields by getting input and output FWSimVariables from VarMap
protected void process(); // Defines net.simplace.sim.model.FWSimComponent

Process the algorithm and write the results back to VarMap
protected void interpolateTable();

protected FWSimComponent clone(FWSimVarMap aVarMap);
// Defines net.simplace.sim.model.FWSimComponent


creates a clone from this SimComponent for use in other threads


}



Hierarchy: java.lang.Object - net.simplace.sim.model.FWSimComponent (net.simplace.sim.util.FWSimFieldContainer) - ValueToTableConverter