Transitions - adolgert/CTDE.jl GitHub Wiki

We define the simulation by creating what is called a PartialProcess. For example, given a simple state,

state=zeros(Int, 10)
state[1]=1
process=PartialProcess(state)

Then we add transitions to that partial process with AddTransition!.

AddTransition!(process::PartialProcess, hazard::Intensity, hazard_dependencies, firing::Function, firing_dependencies, name)

  • process::PartialProcess is the process to whom the transition is added.
  • hazard::Intensity decides, given the current state since this transition last fired, what is the current probability this transition will fire? That may be zero, in which case the hazard is disabled.
  • hazard_dependencies is a list of keys to substates. These keys will be passed to the hazard in order for it to make its decision whenever the any of these substates could possibly have changed.
  • firing::Function is a function which takes a first argument, the state, and a variable number of following arguments, which are keys to substates which it needs in order to change the state. This function returns a list of keys to substates affected when it fired.
  • firing_dependencies is a list of keys to substates to pass to the firing function later.
  • name is a a friendly name for the transition.