140 likes | 161 Views
Event-Driven Models. Continuous-time vs Discrete-event Models. GoldSim was originally built as a continuous-time simulator: “Rates of change”, predefined time steps... Gradually more and more discrete-event modeling capabilities have been added: Timed Event Generator Discrete Changes
E N D
Continuous-time vs Discrete-event Models • GoldSim was originally built as a continuous-time simulator: “Rates of change”, predefined time steps... • Gradually more and more discrete-event modeling capabilities have been added: • Timed Event Generator • Discrete Changes • Reservoir overflows • Reliability Failures & Repairs • Etc. etc. • These changes have led to a much more complex model-updating logic.
Events and Discrete Changes • An “Event” is a special type of output that is sent out at discrete times during a simulation. It carries no information other than its occurrence. • A “Discrete Change” is like an Event, but it also carries a value and an instruction: “Add” or “Replace”. • Events can only connect to a “Trigger” in another element. • It’s not their primary purpose, but Discrete Changes can also be used in Triggers.
Elements that can Interrupt the Clock • The following element types can insert scheduled events that interrupt the model clock: • Timed Event Generator • Reservoir overflow, underflow • Reliability failure time, repair time • Time Series element (discrete changes) • Event Delay • Discrete Change Delay • Fund (interest charges) • Option (on maturity)
The Timed Event Generator • Comes in five flavors • Has Cum_Emitted output
Interrupting the Clock • The user can disable clock interruption if desired:
The Trigger Dialog • Comes with five flavors of trigger input. • Optionally, after the triggering event, the trigger will wait until a specified condition is true. • Optionally, it will then “fire” only if another condition is true.
Event-processing Elements • Emit only: • Timed Event Generator • Reservoir overflow, underflow • Receive only: • Conditional Container • Stochastic • Emit & Receive: • Event Delay • Triggered Event Generator • Decision • Random Choice • Milestone • Status • Discrete Change • Reliability • Splitter, Allocator • Option
GoldSim’s Updating Process • When a model is being edited, GoldSim maintains a ‘causality sequence’ that is used at run time. • Links between elements are not made unless a valid causality sequence can be established. • Separate, private causality sequences exist for Submodels and for Containers with the ‘Treat as Subsystem’ option selected.
Discrete-Change-processing Elements • Discrete Change Generator • Time Series element (discrete changes) • Reservoir • Discrete Change Delay • Splitter, Allocator • Fund (interest charges) • Option (on maturity) • Insurance
GoldSim’s Updating Process (simplified) • Update static elements in sequence. Supported element types: • Data • Expression • Stochastic • Selector • Table • Update all initial values (inputs must be static). • For each time step: • Set the clock to the new time. • Process any ‘dynamic’ elements that can change with time. • Update all function elements in sequence.
Dynamic Elements • These elements have outputs that represent ‘State variables’ for the model. • Those outputs are available by any element at any time. • This allows such element to reference their own current values, directly or indirectly. • Some of those outputs can be hybrids (“Front/Back”), which can change with time and also during the function update. • Elements that reference front/back outputs TRY to sequence after the output, but they don’t have to.