This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.
This is a fairly elaborate class serving as a building block for delay components. Since inflows to and outflows from a stock should be modeled using the same component, the class provides machinery to either deduct outflowing material at once or after it has left the stock (at the end of the delay process).
The delayTime
is given by a parameter, that is (optionally) multiplied by an exogenous input u as to enable exogenous input of delay times (e.g., delayTime = 1
and hasFactor = true
) or have the time of delay be modified by other variables.
The stock value reported at the stock port portA
is determined from the choices made with regard to outflowing material (deducted or not), while the flags are immediately copied from the flow port portB
.
<...> protected parameter Real k2 = if subtractDelayedOutflow then -1 else 0 \ "Gain of outflowing elements of stock B being delayed"; <...> equation // set stock port variables portA.stopInflow = portB.stopInflow; portA.stopOutflow = portB.stopOutflow; portA.stock = actualStockB.y; // set rate inputs growthRate = if portA.rate >= 0 then portA.rate else 0; declineRate = if portA.rate < 0 then -portA.rate else 0; <...>
Name | Description |
---|---|
MaterialType | Type choice for material flowing in and out of the connected stock |