Download presentation
Presentation is loading. Please wait.
Published byGladys Wiggins Modified over 9 years ago
1
eCGE (Enhanced Petri Net Graphical Editor) : A Multi-Platform Petri Net Editor 15 April 2005 David Dugan
2
Overview Role of Petri Nets in software development and testing Role of Petri Nets in software development and testing How CGE implements Stochastic Petri Nets How CGE implements Stochastic Petri Nets History of CGE and how eCGE enhances capability History of CGE and how eCGE enhances capability Design of eCGE Design of eCGE Test Cases Test Cases Future plans and conclusion Future plans and conclusion
3
Verification of design requirements Through formal testing or simulation of the environment Through formal testing or simulation of the environment Very costly and time consuming Very costly and time consuming Difficult to go thru all possible execution paths Difficult to go thru all possible execution paths Difficult to simulate timing problems Difficult to simulate timing problems Does not catch problems until well into coding phase Does not catch problems until well into coding phase Performance modeling though a special graphical language formalism Performance modeling though a special graphical language formalism Temporal specifications for time-critical systems Temporal specifications for time-critical systems Probabilistic specifications to describe selection among different possible events Probabilistic specifications to describe selection among different possible events Performance modeling through graphics Performance modeling through graphics
4
Petri Nets - Graphical Modeling of Critical Timing Applications Flow charts, block diagrams, state diagrams do not show timing or probability of events Flow charts, block diagrams, state diagrams do not show timing or probability of events Firing time in Petri Nets is the delay time before a transition can take place Firing time in Petri Nets is the delay time before a transition can take place Immediate (Deterministic) – Fixed delay time Immediate (Deterministic) – Fixed delay time Timed (Stochastic) – Random or asynchronous time Timed (Stochastic) – Random or asynchronous time
5
eCGE Benefits eCGE provides a graphical means to specify a Stochastic Petri Net Model to model the dynamic as well as static aspects eCGE provides a graphical means to specify a Stochastic Petri Net Model to model the dynamic as well as static aspects Output of eCGE can be input into the Stochastic Petri Net Package to obtain numerical results for the model using Markov analysis Output of eCGE can be input into the Stochastic Petri Net Package to obtain numerical results for the model using Markov analysis
6
eCGE Goals Model a system quickly and inexpensively Model a system quickly and inexpensively Produce a tool that does not require extensive training Produce a tool that does not require extensive training Be able to use the model to communicate to customers Be able to use the model to communicate to customers
7
CGE Background Original work by Norb Gravelle proof of concept that CSPL coding language can be generated from a graphical interface instead of a text editor Original work by Norb Gravelle proof of concept that CSPL coding language can be generated from a graphical interface instead of a text editor Work by Wen Wei extended this tool to include graphical layout algorithms Work by Wen Wei extended this tool to include graphical layout algorithms Spring Algorithm Spring Algorithm Tree Algorithm Tree Algorithm
8
eCGE Components ComponentLanguage GUI Framework Design Methodology OS Supported Original CGE C++ MS Visual Studios procedural MS Windows CSPL parser C++ N/A – command line application object-orientedany Spring and Tree Algorithm s C++ N/A – selected by a menu item proceduralany Enhanced CGE Java AWT / Swing object-oriented any supporting Java 1.4
9
My Contribution Combined work by Gravelle, Wei, and CSPL parser into a single application Combined work by Gravelle, Wei, and CSPL parser into a single application Added parser to import CSPL files Added parser to import CSPL files Designed the application using object-oriented analysis and design techniques for future enhancements Designed the application using object-oriented analysis and design techniques for future enhancements Designed an interface for future development of graph layout algorithms Designed an interface for future development of graph layout algorithms Added a Random graph layout algorithm Added a Random graph layout algorithm
10
CSPL (C Based Stochastic Petri-net language) Specification language for Stochastic Petri Net package - CSPL - can be used to specify complex system behaviors with Petri nets Specification language for Stochastic Petri Net package - CSPL - can be used to specify complex system behaviors with Petri nets CSPL Conversion Process CSPL Conversion Process Reads in CSPL file to determine elements and attributes of model Reads in CSPL file to determine elements and attributes of model CGE Language adds graphical information for each model element CGE Language adds graphical information for each model element
11
Enhancements to CGE I Ability to read in a CSPL file and display it graphically Ability to read in a CSPL file and display it graphically Edit and display an imported CSPL file Edit and display an imported CSPL file Parameters for a model are input through dialog boxes Parameters for a model are input through dialog boxes Specify the properties of a place, transition, or arc Specify the properties of a place, transition, or arc Interface for defining guard function Interface for defining guard function Read and save a model in CGE format Read and save a model in CGE format
12
Enhancements to CGE II Consistency checking of parameters insures a syntactically correct model Consistency checking of parameters insures a syntactically correct model Improved maintainability of design through complete redesign of code based on object oriented design Improved maintainability of design through complete redesign of code based on object oriented design Rewrote all code in JAVA to enhance portability to other platforms Rewrote all code in JAVA to enhance portability to other platforms Added a Random Graph Layout Algorithm Added a Random Graph Layout Algorithm
13
CGE Evolution First IterationSecond Iteration
14
CGE Evolution Third IterationFourth Iteration
15
eCGE Design Redesign and integration of legacy CGE components into eCGE Redesign and integration of legacy CGE components into eCGE Gravelle’s Original CGE Gravelle’s Original CGE Wen Wei Graphical Layout algorithms Wen Wei Graphical Layout algorithms CSPL parser CSPL parser Used Object Oriented Design to integrate these components into a single application Used Object Oriented Design to integrate these components into a single application
16
Legacy Design Approach
17
eCGE Classes High-Level Class Chart for eCGE High-Level Class Chart for eCGE An appendix in the thesis describes the design and implementation details An appendix in the thesis describes the design and implementation details Class charts Class charts Design and implementation details of key components Design and implementation details of key components
18
Case Studies Case # 1 - Connected Cyclic Reliability (CCR) model for the anti-lock braking system Case # 1 - Connected Cyclic Reliability (CCR) model for the anti-lock braking system Analyzed the mean time to failure for the braking system of a vehicle Analyzed the mean time to failure for the braking system of a vehicle Case # 2 - How the layout affects understanding and finding problems in a Petri net model (race condition). Case # 2 - How the layout affects understanding and finding problems in a Petri net model (race condition).
19
Case Study # 1 – CCR Model Model input from CSPL language and translated into CGL language Model input from CSPL language and translated into CGL language Layout (Spring and Tree) algorithms proved inadequate to handle the reformatting of graphical layout of a complex model Layout (Spring and Tree) algorithms proved inadequate to handle the reformatting of graphical layout of a complex model eCGE requires further enhancements to resolve the layout of complex models, as shown in the following figures. eCGE requires further enhancements to resolve the layout of complex models, as shown in the following figures.
20
Layout using Random Algorithm Method Applying the Random Algorithm results in this arrangement. Applying the Random Algorithm results in this arrangement.
21
Layout using Manual Methods Manually laying out the elements provides a more readable layout. Manually laying out the elements provides a more readable layout.
22
Case Study 2 The use of layout is important in understanding the structure of a model and detecting potential problems The use of layout is important in understanding the structure of a model and detecting potential problems Types of possible problems: Types of possible problems: Conflict Conflict Confusion (analogous to a race condition) Confusion (analogous to a race condition)
23
Example of how a race condition “conflict” can be in Petri Net p = places, t = transitions, 1 = tokens p = places, t = transitions, 1 = tokens Figures 3a and 3b represent confusion as to which path program will take based on which token fires first Figures 3a and 3b represent confusion as to which path program will take based on which token fires first
24
CSPL Code for prior example of conflict (race condition) The following segment shows the equivalent CSPL code for the previous example The following segment shows the equivalent CSPL code for the previous example The textual version shows the elements, but not the graphical structure, of the model The textual version shows the elements, but not the graphical structure, of the model
25
Future Enhancements of eCGE Enhance graph layout algorithms to handle more complex structures Enhance graph layout algorithms to handle more complex structures Be able to import and translate other Petri Net modeling tools file formats Be able to import and translate other Petri Net modeling tools file formats Add a scroll bar to document window to increase work space Add a scroll bar to document window to increase work space Be able to group elements to move them Be able to group elements to move them Incorporate an algorithm to minimize arc crossings (such as the various graphviz layout algorithms, see http://www.graphviz.org/ ) Incorporate an algorithm to minimize arc crossings (such as the various graphviz layout algorithms, see http://www.graphviz.org/ )
26
Conclusions I eCGE has integrated a number of separate programs which represent a foundation for using Stochastic Petri Nets in industry eCGE has integrated a number of separate programs which represent a foundation for using Stochastic Petri Nets in industry Mechanizing and simplifying the development of a model by using a graphical, rather than textual, interface Mechanizing and simplifying the development of a model by using a graphical, rather than textual, interface Being able to visualize time critical events via the Petri net diagrammatic language using eCGE facilities and layout algorithms Being able to visualize time critical events via the Petri net diagrammatic language using eCGE facilities and layout algorithms Including visualization of a large library of legacy (textually based) CSPL models
27
Conclusions II Increased maintainability of the code using object-oriented design makes it easier to further enhance the application Increased maintainability of the code using object-oriented design makes it easier to further enhance the application Made programs/components of CGE platform independent through use of JAVA to encourage usage on a variety of platforms Made programs/components of CGE platform independent through use of JAVA to encourage usage on a variety of platforms
28
Questions & Answer Session Mr. Dugan has a severe speaking disability (WSU has certified) and for the purposes of the defense we asked him to write the answers to the committee’s questions.
29
Ordinary Petri Net A biparte graph that consists of A biparte graph that consists of A set of Places A set of Places A set of Transitions A set of Transitions A set of directed Arcs A set of directed Arcs Arcs connect Places to Transitions Arcs connect Places to Transitions Input Arc - Directed Arc from Place to Transition Input Arc - Directed Arc from Place to Transition Output Arc - Directed Arc from Transition to Place Output Arc - Directed Arc from Transition to Place
30
Ordinary Petri Net Formal Definition PN = (P,T,A) PN = (P,T,A) P= {p1, p2,….p(n)} P= {p1, p2,….p(n)} T= {t1,t2,….t(m)} T= {t1,t2,….t(m)} A = {a1, a2, …, a(o)} - arcs A = {a1, a2, …, a(o)} - arcs
31
Generalized Stochastic Petri Net (GSPN) Time is associated with Transition Time is associated with Transition Transitions are immediate and timed Transitions are immediate and timed Immediate - Fire immediately when enabled and the logical structure is modeled, but not the timing Immediate - Fire immediately when enabled and the logical structure is modeled, but not the timing Timed -Fire after a random,exponentially distributed enabling time Timed -Fire after a random,exponentially distributed enabling time Example of timed - A finite time delay until a hardware device is ready to accept the command before issuing it Example of timed - A finite time delay until a hardware device is ready to accept the command before issuing it Timed - Used with devices that cannot respond at the program execution rate Timed - Used with devices that cannot respond at the program execution rate Example of Immediate - Usual case in programming where transitions are made at the same rate as program execution Example of Immediate - Usual case in programming where transitions are made at the same rate as program execution
32
Markings Tangible - Only timed transitions are enabled in a marking Tangible - Only timed transitions are enabled in a marking Vanishing - At least one immediate transition is enabled in a marking. May be removed in the analysis to reduce time and space complexity Vanishing - At least one immediate transition is enabled in a marking. May be removed in the analysis to reduce time and space complexity Absorbing Absorbing Applies to a place which has no output Arcs Transition firing adds a token to this place However, the token can no longer be used to enable a transition
33
Consistency Checking Drawing Window Drawing Window Shows an error message for an illegal operation Shows an error message for an illegal operation For example, conecting a place to a place For example, conecting a place to a place Dialogue Boxes Dialogue Boxes Grays out boxes or input fields(allows operator no input) if operation is illegal or undefined Grays out boxes or input fields(allows operator no input) if operation is illegal or undefined Example - Transition Dialogue Box cannot have a Guard Function if no functions have been defined Example - Transition Dialogue Box cannot have a Guard Function if no functions have been defined
34
Spring Algorithm Places and transitions are like weights on springs Places and transitions are like weights on springs Starts from the first arc Starts from the first arc Simulates a mechanical system consisting of springs (arcs) and nodes (places and transitions). From the initial configuration or ring positions, the system oscillates until it stabilizes at a minimum-energy configuration. It has been noted that in such a configuration, all the edges typically have relatively uniform length and nodes not connected tend to be far apart. Simulates a mechanical system consisting of springs (arcs) and nodes (places and transitions). From the initial configuration or ring positions, the system oscillates until it stabilizes at a minimum-energy configuration. It has been noted that in such a configuration, all the edges typically have relatively uniform length and nodes not connected tend to be far apart.
35
Tree Algorithm The goal of this algorithm is to produce a graph that is planar, straight-lined, and upward (that is, a ‘parent’ node is above its ‘children’). Vertices at the same level are horizontally aligned. The first place in the place list is chosen to be the root of the tree. The goal of this algorithm is to produce a graph that is planar, straight-lined, and upward (that is, a ‘parent’ node is above its ‘children’). Vertices at the same level are horizontally aligned. The first place in the place list is chosen to be the root of the tree. The space (vertical distance) between each level is uniform. The space (vertical distance) between each level is uniform. The separation distance between two consecutive vertices on the same level is kept to a minimum. The separation distance between two consecutive vertices on the same level is kept to a minimum. The overall width of the graph is as small as possible and still be readable. The overall width of the graph is as small as possible and still be readable.
36
Other ways of laying out graphs Reference Article: Empirical Layout of Aesthetics-based Graph Layout by Purchase, Carrington, and Allder Reference Article: Empirical Layout of Aesthetics-based Graph Layout by Purchase, Carrington, and Allder Planar Grid Drawing Algorithm Planar Grid Drawing Algorithm Force Directed Algorithm Force Directed Algorithm Goals of Graph layout program Goals of Graph layout program Minimize edge crossings Minimize edge crossings Orthogonality Orthogonality Information Flow (connected nodes should be close together) Information Flow (connected nodes should be close together) Minimize edge bends Minimize edge bends
37
Weaknesses of Graphical Approaches Reference Article: Empirical Layout of Aesthetics-based Graph Layout by Purchase, Carrington, and Allder Reference Article: Empirical Layout of Aesthetics-based Graph Layout by Purchase, Carrington, and Allder No one type of layout works for every graph No one type of layout works for every graph Graph layout requires a significant computational power Graph layout requires a significant computational power History of the flow chart History of the flow chart How to show a large graph in a drawing window: How to show a large graph in a drawing window: Add scroll bars Add scroll bars Re-size the model (zoom in and out) Re-size the model (zoom in and out)
38
Understanding A graphical representation of a Petri Net tends to be at a higher level of abstraction than a textual representation A graphical representation of a Petri Net tends to be at a higher level of abstraction than a textual representation affects response time affects response time Easier to see errors Easier to see errors Shows the structure of the model Shows the structure of the model
39
Extensibility Interface for graph layout algorihm described in section A.3 of thesis Interface for graph layout algorihm described in section A.3 of thesis Adding a graph layout algorithms requires the following steps: Adding a graph layout algorithms requires the following steps: Create a new subroutine containing the implementation (class document_class) Create a new subroutine containing the implementation (class document_class) Add a new menu item in the Algorithms menu bar (class algorithms_menu) Add a new menu item in the Algorithms menu bar (class algorithms_menu) Add code so that when the menu item is selected, the correct subroutine is called (affects classes document_manager, document_internal_frame, and document_panel) Add code so that when the menu item is selected, the correct subroutine is called (affects classes document_manager, document_internal_frame, and document_panel)
40
Ease of Use Goal is to minimize the amount of effort required to use the tool such as Goal is to minimize the amount of effort required to use the tool such as Minimizing keystrokes Minimizing keystrokes Logically organizing the layout of dialog boxes Logically organizing the layout of dialog boxes
41
OO Design Maintainability The system architecture uses fine grained, self contained components that can readily be changed The system architecture uses fine grained, self contained components that can readily be changed Avoids shared data structures and global variables (minimizes data coupling) Avoids shared data structures and global variables (minimizes data coupling) Each class is self-contained - all relevant operations and data are contained within the class Each class is self-contained - all relevant operations and data are contained within the class
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.