Working With Time
While most ModelHost models only need to respond to changes in data, some models are time-sensitive (such as forecasting models, running averages/standard deviations or time-series AIs).
You can force an output to update once every second by making the output depend on the internal ModelHost clock.
@mdl.part("Time Triggered Model") def TimeTrigger(mod): TX = mod.AddInput("Time",0,"#Internal.Clock") Input = mod.AddInput("Value",0,"ARDI Asset.Value") mod.AddOutput("Result",lambda: float(Input)+20,[Input,TX])
The code above will re-calculate the 'result' every second.