1 / 16

Chapter16 Methodology: How to Model and Simulate

Chapter16 Methodology: How to Model and Simulate. M&S Methodology. First think about your objectives- find a level of difficulty that seems achievable in the time available. Develop the experimental frames first to meet these objectives.

sagira
Download Presentation

Chapter16 Methodology: How to Model and Simulate

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter16 Methodology: How to Model and Simulate

  2. M&S Methodology • First think about your objectives- find a level of difficulty that seems achievable in the time available. • Develop the experimental frames first to meet these objectives. • Develop your atomic models and coupled models and and test them in hierarchical stage wise fashion in SimView. • Start your exploratory phase -- get some preliminary results of execution within experimental frames. What is the “lay of the land”? Which factors appear to matter most? • Start your production runs (for final results) by concentrating on the factors that seem to be important from your initial exploration. • If you need better performance, remove all unessential code, including output and print statements. Switch execution from SimView to fast-as-can simulation as shown next. • For greater performance migrate your model to parallel/distributed fast-as-can simulation (not currently available). • If your objectives were to develop real-time execution models, migrate them to real-time execution (distributed, non-distributed) as shown next.

  3. Suggested Project Report Outline • Problem statement – Objectives of the Project • General Description of the System to be Studied • Objectives of the Modeling and Simulation Study • The Simulation Model • System Entity Structure or Hierarchical diagrams and • explanation of operation • Illustrative DEVSJAVA code or pseudo code • Experimental frame and how it serves to achieve the Objectives • Experiments • Results ( or expected results) • Conclusions (what did you learn from this work • Future Work • References • Appendix: more details or code

  4. Categorizing Simulation Modes and Packages in DEVSJAVA

  5. Model Development using Model Continuity Implementation/ Logical Simulation Model Distribution/ Distributed Simulation Real-Time Distributed Simulation/ Execution Modeling Checks Model Logical Behavior Checks Model Logical Behavior in Distributed Environment Checks Model Temporal Behavior DEVS Formalism genDevs. simulation. distributed genDevs. simulation. realTime genDevs. simulation

  6. Using inheritance and polymorphism to allow easy switching from structure/behavior viewing to fast simulation Viewable Digraph SimView Coordinator coupledRTSimulator Viewable Atomic ViewableAtomic Simulator Viewable Digraph coordinator digraph coupledSimulator Viewable Atomic atomic atomicSimulator Later, when ready for production runs, execute them without change in fast-as-can simulation Even though ViewableAtomic and ViewableDigraph models can hold information intended for SimView, they need not be altered to run outside of SimView. For example, to run a ViewableDigraph model in a main routine define: public static void main(String args[]){ ViewableDigraph d = new (Random,rule30CellSpace): r = new coordinator (d); r.initialize(); //to measure execution time if desired: initTime = System.currentTimeMillis(); r.simulate(100); termTime = System.currentTimeMillis();} This can be executed in JBuilder of by changing directory to DevsJava/classes and entering on the command line – >java Random.rule30CellSpace You can develop models and test them in SimView simView. ViewableDigraph To understand how this is possible, consider that in atomicSimulator the Devs Simulator Cycle implementation includes “hooks” within its methods, e.g., public void computeInputOutput(double t){ if(equalTN(t)) { output = myModel.Out();} else{output = new message();} computeInputOutputHook1() ;} These hooks are dummy methods within atomicSimulator, e.g., protected void computeInputOutputHook1() {} In ViableAtomicSimulator the hooks are given definitions that allow the SimViewCoordinator to get the infromation it needs to display in SimView, .e.g., protected void computeInputOutputHook1(){ if (listener == null) return; ContentIteratorInterface iterator = output.mIterator(); while (iterator.hasNext()) { ContentInterface content = iterator.next(); listener.contentOutputted((content)content,\ viewableAtomic, content.getPort().getName()); } } simView. ViewableAyatomic

  7. Using toString() and toObject() to facilitate deploying models in distributed simulation receiver sender DEVS simulator uses toString() to encode the entity as a String which is sent across the wire public message out( ){ message m = new message(); m.add(makeContent("out", new vect2DEnt(x,y))); return m; } public void deltext(double e ,message x){ for (int i=0; i< x.getLength();i++) if (messageOnPort(x,“in",i)) { entity en = x.getValOnPort(“in",i); position = vect2DEnt.toObject(en); } The modeler also needs to define toObject() and use this method in decoding the message. public static vect2DEnt toObject(String nm){ int commaIndex = nm.indexOf(","); String xs = nm.substring(0,commaIndex); String ys = nm.substring(commaIndex+1,nm.length()); return new vect2DEnt(Double.parseDouble(xs),Double.parseDouble(ys)); } public static vect2DEnt toObject(entity ent){ return toObject(ent.getName()); } The modeler must define toString() for the simulator to use polymorphically. For example: public String toString(){ return doubleFormat.niceDouble( x ) + ","+doubleFormat.niceDouble(y); } public String getName(){ return toString(); }

  8. Deploying a coupled model onto a distributed, decentralized, real-time simulation For the coupled model define a RTCoordinatorServer,e.g.,: public class StartVehicleSpaceServer{ public static void main(String[] args) { try{ System.out.println("For use by clients, this host is " +InetAddress.getLocalHost().getHostAddress()); }catch(Exception c){} new RTCoordinatorServer(new vehicleSpace(), 10);} You can develop models and test them in SimView This will give you the address needed by clients For each component model define a RTCoordinatorClient, e.g.,: public class StartEvaderClient{ public static void main(String[] args) { new RTCoordinatorClient( new vehicle("evader",new vect2DEnt(40,40)), "192.168.1.101", //RTCoordinatorServer’s address //or if on same machine as the server //you can use "localhost", Constants.serverPortNumber); }} StartPursuer Client StartVehicleSpaceServer StartEvader Client Continuity. StartVehicleSpaceServer intranet or internet Later, when ready for production runs, execute them without change in distributed, real0time, decentralized simulation You can now distribute these classes onto one or more computers and execute them from jBuilder or from the command line as illustrated before. You can also distribute hierarchically using RTCoordinatorServerAndClient

  9. V&V

  10. General System Philosophy George Klir, “Architecture of General Systems”

  11. uses the formalism of Framework for Modeling and Simulation Mathematical Systems Theory is interpreted by Hierarchy of System Specifications entities Hierarchy of Specification Morphisms relations Modeling & Simulation/Systems Theory

  12. Real World Simulator modeling relation simulation relation Model Experimental Frame Collaboration Decision Search Modeling DEVS Simulation HLA/SOA Network M&S Framework Objectives represented by Layered architecture Entities formalized as systems; relations as system morphisms

  13. DEVS Modeling & Simulation Framework • DEVS = Discrete Event System Specification • Provides sound M&S framework • Derived from Mathematical dynamical system theory • Supports hierarchical, modular composition and reuse • Can express Discrete Time, Continuous and hybrid models • Event-orientation enables efficient simulation • HLA/SOA enables interoperability of existing simulations • DEVS supports developing new simulation models within an object-oriented computational framework

  14. Inter-satellite Communication Collaboration Decision Search ME Modeling DEVS Simulation HLA Threat Analysis Network Relay Joint MEASURETM • Jointly Developed by Lockheed and UA under DARPA ASTT • Mission Effectiveness Simulator for • System-of-Systems • employs moderate level of resolution Threat Detection Data JM Application: C4ISR System-of-System Design WAN link *Mission Effectiveness Analysis Simulator for Utility, Research and Evaluation

  15. System specification levels Morphisms at each level Hierarchy of System Specifications and Morphisms simulation model construction at high levels V&V loop structure to behavior behavior to structure experimental testing at low levels

  16. V&V

More Related