HYBRID ATOMIC PDEVS am_truck
stored in DEVS_PATH/01-atomic-modelbase/orange_juice_canning/am_truck.m
Contents
Description
Class definition file for an hybrid atomic PDEVS model that implements a truck, that arrives filled with 2000 gallons and is then unloaded.
constructor call: obj = am_truck(name,inistates,c_inistates,elapsed)
Superclass
hybridatomic (superclass acts as associated hybrid 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
- dq = f(obj,gt,x,y): rate of change function - returns derivations
- ret = cse(obj,gt,y): state event condition function - checks, if there are events
- deltastatefun(obj,gt,y,event_number): state event transition function - describes the reaction on state events
- cy = lambda_c(obj,gt,y): continuous output function
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
- showcontstates(obj): display continuous states
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)
inherited from hybridatomic:
- c_states: vector of continuous variables
- output_length : length of output-vector returned by lamda_c
- mealy: 1 or 0, model is of mealy or moore type
Ports
has two inputs x: in1 and in2, 1 for incoming trucks, one for suspend-unloading and restart-unloading signals
has two outputs y: out1 and out2, 1 to send empty truck to undocking server, 1 to send truck-arrival signal to canner
Note: continuous couplings need no ports. They are managed via continuous variables' indices.
States
discrete in s:
s.sigma: for time advance
s.active: 0 or 1, 1 if unloading is allowed, 0 if not
s.arrival: marks, if last external event was truck arrival
continuous:
c_states = [TruckLevel; TruckRate]
Hybrid Characteristics
mealy = 0: model is of Moore type
output_length = 1: the function lamda_c returns 1 element (current TruckRate)
state events:
- if truck is empty
System Parameters in sysparams
none
More
global SIMUSTOP : can be used to stop allover simulation
DEVS Tbx Home Examples Modelbase << Back