ATOMIC PDEVS event_detect
stored in DEVS_PATH/01-modelbase/qss/event_detect.m
Contents
Description
Class definition file for an atomic PDEVS model which acts as QSS1 event detection for model of bouncing ball. Becomes active, when ball hits the ground,
It is not an universal QSS1 event detection atomic, because detection of state events depends on model. THIS event detection atomic reacts on a zero-crossing from + to - . It could act as blueprint to develop QSS1 event detection atomics for other purposes.
constructor call: obj = event_detect(name,inistates,elapsed)
Superclass
atomic (superclass acts as associated simulator)
Class Methods
characteristic functions:
- ta = tafun(obj) : time advance function - calculates time until next internal event by evaluating the states in s
- deltaconffun(obj,gt) : confluent function - calculates from states s, inputs x and elapsed time elapsed the new states s', if there is an internal and an external event at the same time
- deltaextfun(obj,gt) : external transition function - calculates from states s, inputs x and elapsed time elapsed the new states s'
- deltaintfun(obj) : internal transition function - calculates from states s the new states s'
- lambdafun(obj) : output function calculates from states s the ouptputs y
display functions:
- showall(obj) : display the object
- showxports(obj) : display x-ports and values
- showyports(obj) : display y-ports and values
- showstates(obj) : display states in s
- showsysparams(obj): display system parameters in sysparams
Inherited Properties
inherited from atomic:
- name : string, (unique) name of this model --> for debugging purposes max. 12 characters for "nice" debug-look ;-)
- x : structure, set of inport name/input value pairs
- y : structure, set of outport name/output value pairs
- s : structure, set of states
- sysparams : structure, set of system parameters, can be set only once at instantiation
- elapsed : float, time elapsed since last transition (only for initialization)
- debug_flag: 0|1|2|3, no messages|messages|steps|visualize x, y, and s (default 0)
- observe_flag: 0|1, log states of atomic subcomponents or not (default 0)
- observed : cell array including time stamps and a copy of s (structure of states)
Ports
has one input x : in1 for quantized rate of change
has one output y : out1, output a state event signal
States in s
s.sigma : for time advance
s.X : X values
s.dX : derivation
s.traj : to manually record exact values (X/t pairs)
s.se : marks, if an event is possible. Is set to 1, if derivation s.dX is < 0 and set to 0 otherwise.
System Parameters in sysparams
none
More
global SIMUSTOP : can be used to stop allover simulation e.g. when a predefined number of jobs has finished
DEVS Tbx Home Examples Modelbase << Back