Previous Next


Iteration Event

Description

Raised each iteration of a simulation. During this event, you should sample your input distributions and assign values to all output variables.

Syntax

RDKApp_Iteration(whichSim As Long, whichIter As Long, cancel as Boolean)

Arguments

whichSim (Long) – the number of the current simulation.

whichIter (Long) – the number of the current iteration of the current simulation.

cancel (Boolean) – set to true to end the simulation after the current iteration

Example

Private Sub RDKApp_Iteration(whichSim As Long, whichIter As Long,cancel as Boolean)
    Dim r as Double, c as Double
    With RDKApp
        r = .Inputs("Revenue").RISKNormal(100,1)
        c = .Inputs("Costs").RiskExpon(2)    
        .Outputs("Profit") = r - c
    End With    
End Sub