Presentation is loading. Please wait.

Presentation is loading. Please wait.

System Design Research Lab University of Pennylvania 1/29/2002 CHARON modeling language.

Similar presentations


Presentation on theme: "System Design Research Lab University of Pennylvania 1/29/2002 CHARON modeling language."— Presentation transcript:

1 System Design Research Lab University of Pennylvania 1/29/2002 CHARON modeling language

2 System Design Research Lab University of Pennylvania 1/29/2002 Outline Overview of language features Example Charon toolset Toolset demo Obtaining and running the toolset

3 System Design Research Lab University of Pennylvania 1/29/2002 Language features: hierarchy Architectural hierarchy –Autonomous agents can contain subagents –Agents execute concurrently and asynchronously –Communication via shared variables Behavioral hierarchy –Each agent is described as a state machine modes and transitions –Modes can contain submodes

4 System Design Research Lab University of Pennylvania 1/29/2002 Language features: modularity Encapsulation –Local (private) variables restrict communication and hide details of behavior Instantiation –An agent or mode defined in the model can be instantiated multiple times –Agents and modes can have parameters that are given values at instantiation

5 System Design Research Lab University of Pennylvania 1/29/2002 Agents: architecture and data flow Agents are autonomous concurrent components in the model An agent consists of variable definitions and may contain sub-agents Agent interfaces are global variables Tank Hole leak private analog real leak level inflow LTank Pump level flow

6 System Design Research Lab University of Pennylvania 1/29/2002 Agents: definition and instantiation // the tank agent with a hidden leak agent LTank() { private analog real leak; agent tank = Tank(); agent hole = Hole(); } // a leaky tank controlled by a pump agent LeakyTank() { private analog real level, flow; agent tank = LTank( ) [ inflow := flow ] agent pump = Pump( 5, 10 ) } definition instantiation parameterized instantiation

7 System Design Research Lab University of Pennylvania 1/29/2002 Primitive agents A primitive agent does not have concurrent structure –single thread of control Behavior is given by a mode agent Tank() { write analog real level; init { level = 6; } mode top = TankMode( ); }

8 System Design Research Lab University of Pennylvania 1/29/2002 Modes: behavior A mode is a hierarchical hybrid state machine A primitive mode is a single-state machine Behavior is given by constraints mode TankMode() { read analog real inflow; read analog real leak; write analog real level; diff { d(level) == inflow-leak } inv { 0 <= level and level <= 15 } } inflow leak

9 System Design Research Lab University of Pennylvania 1/29/2002 Modes: behavior + discrete control Composite modes have multiple submodes and discrete transitions between them PumpModeprivate analog real clock diff { d(clock) == 1 } start return Compute Maintain onturnOff offadjust inv { clock <= 1 } clock >= 1 {clock = 0}

10 System Design Research Lab University of Pennylvania 1/29/2002 Modes: behavior + discrete control Modes have variable declarations, same as agents PumpModeprivate analog real clock diff { d(clock) == 1 } start return Compute Maintain onturnOff offadjust inv { clock <= 1 } clock >= 1 {clock = 0}

11 System Design Research Lab University of Pennylvania 1/29/2002 Modes: behavior + discrete control Modes can have constraints at any level PumpModeprivate analog real clock diff { d(clock) == 1 } start return Compute Maintain onturnOff offadjust inv { clock <= 1 } clock >= 1 {clock = 0}

12 System Design Research Lab University of Pennylvania 1/29/2002 Modes: behavior + discrete control Transitions are instantaneous Transitions have guards and actions PumpModeprivate analog real clock diff { d(clock) == 1 } start return Compute Maintain onturnOff offadjust inv { clock <= 1 } clock >= 1 {clock = 0}

13 System Design Research Lab University of Pennylvania 1/29/2002 Modes: behavior + discrete control Transition can happen when its guard is true Transition must happen when invariant is false PumpModeprivate analog real clock diff { d(clock) == 1 } start return Compute Maintain onturnOff offadjust inv { clock <= 1 } clock >= 1 {clock = 0}

14 System Design Research Lab University of Pennylvania 1/29/2002 Control points Mode interface: entry and exit points –Control enters mode via entry points and exits via exit points Different paths through a mode correspond to different qualitative behaviors slow fast set=25 set=65 alge { speed == set } crash stop

15 System Design Research Lab University of Pennylvania 1/29/2002 Named vs. default control points Default control points allow: –preemption –history start return Compute Maintain onturnOff offadjust inv { clock <= 1 } clock >= 1 {clock = 0}

16 System Design Research Lab University of Pennylvania 1/29/2002 PumpMode text mode PumpMode( int low, int high ) { private analog real clock; private discrete real rate; write analog real flow; read analog real level; mode m = Maintain( 0.1, low, high ); mode c = Compute(); trans from default to m when true do { clock = 0; rate = 0 } trans from m to c.start when clock > 1 do { clock = 0; } trans from c.return to m when true do { } diff { d(clock) == 1 } }

17 System Design Research Lab University of Pennylvania 1/29/2002 Computational modes Do not have continuous behavior Instantaneous execution Internal structure defines control flow delta = level-past return rate = 0 start delta > 0 rate = -delta delta <= 0 Compute past = level

18 System Design Research Lab University of Pennylvania 1/29/2002 Charon toolset: visual editor

19 System Design Research Lab University of Pennylvania 1/29/2002 Charon toolset: visual editor

20 System Design Research Lab University of Pennylvania 1/29/2002 Charon toolset: control panel

21 System Design Research Lab University of Pennylvania 1/29/2002 Charon toolset: simulation

22 System Design Research Lab University of Pennylvania 1/29/2002 Charon toolset: simulation

23 System Design Research Lab University of Pennylvania 1/29/2002 DEMO

24 System Design Research Lab University of Pennylvania 1/29/2002 How to obtain and use Charon Download Charon from: http://www.cis.upenn.edu/mobies/charon/implementation.html –both the toolkit and the visual editor are available as compressed archives –see installation instructions on the web page Running: –Charon toolkit: run-charon.sh (Solaris/Linux) or run-charon.bat (Win) in the directory CharonCP –Visual editor: run.sh (Solaris/Linux) or run.bat (Win) in the directory CharonVisual


Download ppt "System Design Research Lab University of Pennylvania 1/29/2002 CHARON modeling language."

Similar presentations


Ads by Google