Download presentation
Presentation is loading. Please wait.
Published byViolet Chapman Modified over 9 years ago
1
Design Example: Discrete Event Simulator ©Dr. David A. Workman School of EE and Computer Science University of Central Florida February 15, 2008 Revised: February 19, 2009
2
February 19, 2009(c) Dr. David A. Workman2 Use Case Diagram: Simulator Simulation System Construct World Specify Input Simulate World Output World Objects Report Simulation Data Initialize Simulation User Specify Output Simulation Input File Simulation Log File
3
February 19, 2009(c) Dr. David A. Workman3 Simulation Architecture
4
February 19, 2009(c) Dr. David A. Workman4 Simulation Architecture: Design Template The Passive layer contains all classes that model problem data and inanimate objects of the simulated world. Agents make direct calls on passive objects, but must account for the simulation time consumed when doing so. Passive objects make direct calls to each other, if necessary. Passive objects may be passed from one Agent to another as part of a instance of some Message subclass. This layer contains all the derived subclasses of Message. These classes are used to pass data for servicing interaction events between Agents. Only recipient Agent classes know the content and use of instances of these classes. Methods of Agents receiving messages optionally take parameters which are instances of one (or more) of the Passive classes and return an instance of class Message or one of its sub- classes. Instances of the root class Message carry no data and denote signals that require some action on the part of the receiver Agent. Virtual World Message Players Agent Event 2 Passive Class Layer Message Layer Agent Layer (Active Objects) Interface and Control Layer EventMgr * 1 Other Subclasses All Active Objects * * All Passive Classes/Objects * * * This layer consists of all active object classes. Active objects must be instances of some subclass of abstract class Agent. The simulation progresses as a result of Events created and serviced by Agents. An Event has four components: a Sender agent, a Recvr agent, an instance of some Message subclass, and an event time. When one Agent wishes to interact with another, it must do so by creating an Event that defines a “future” time at which the interaction will occur. The message component defines an action to the Recevr agent and possibly data necessary to complete the action. SimModels ClassesSimMgmt Classes
5
February 19, 2009(c) Dr. David A. Workman5 Simulation Architecture: Student Conversation Conversation Message Players Agent Event 2 Passive Class Layer Message Layer Agent Layer (Active Objects) Interface and Control Layer EventMgr * 1 AnswerMsg * * Question SimModels ClassesSimMgmt Classes Student Answer QuestionMsg
6
February 19, 2009(c) Dr. David A. Workman6 Design Graph: 1 0: Main() 4 Reusable Methods 9 New Methods Class Conversation 1: Conversation() Class Agent 2: Agent() 3: operator>>() 4: Get() Class Student 5: Student() 6: Extract() 7: Get() 1 5 6 3 2 7 4 Use Case 1
7
February 19, 2009(c) Dr. David A. Workman7 Design Graph: 2 0: Main() 5 Reusable Methods 9 New Methods Class Conversation 1: Conversation() 8: Initialize() Class Agent 2: Agent() 3: operator>>() 4: Get() 11: NameOf() 21: ~Agent() Class Student 5: Student() 6: Extract() 7: Get() 13: Initialize() 16: AcceptQuest() 8 20 Class Players 9: Players() 12: setAgent() 14: getAgent() 15: getOther() 20: ~Players() Class Message 10: Message() 9 2 1213 11141516 Class SpeakMsg 17: SpeakMsg() 17 10 Class Event 18: Event() 18 Class EventMgr -3: EventMgr() 19: postEvent() 1921 Use Case 2
8
February 19, 2009(c) Dr. David A. Workman8 Design Graph: 3 0: Main() Class Conversation 1: Conversation() 8: Initialize() 22: Insert() Class Agent 2: Agent() 3: operator>>() 4: Get() 11: NameOf() 21: ~Agent() 23: oper<<() 26: Put() Class Student 5: Student() 6: Extract() 7: Get() 13: Initialize() 16: AcceptQuest() 24: Insert() 25: Put Class Players 9: Players() 12: setAgent() 14: getAgent() 15: getOther() 20: ~Players() Class Message 10: Message() Class SpeakMsg 17: SpeakMsg() Class Event 18: Event() Class EventMgr -3: EventMgr() 19: postEvent() 25 24 22 23 26 Use Case 3 2 Reusable Methods 3 New Methods
9
February 19, 2009(c) Dr. David A. Workman9 Design Graph: 4 0: Main() 2 Class Conversation 1: Conversation() 8: Initialize() 22: Insert() 44: Simulate() Class Agent 2: Agent() 3: operator>>() 4: Get() 11: NameOf() 21: ~Agent() 23: oper<<() 26: Put() Class Student 5: Student() 6: Extract() 7: Get() 13: Initialize() 16: AcceptQuest() 24: Insert() 25: Put() 37: Dispatch() 39: doQuestion() 40: AcceptAnswr() 41: doAnswer() Class Players 9: Players() 12: setAgent() 14: getAgent() 15: getOther() 20: ~Players() Class Message 10: Message() 30: Oper<<() 31: Insert() 32: Put() 42: ~Message() Class SpeakMsg 17: SpeakMsg() 33: Insert() 34: Put() 38: getHandlr() Class Event 18: Event() 29: oper<<() 35: getRecvr() 36: getMsg() 43: ~Event() Class EventMgr -3: EventMgr() 19: postEvent() 27: moreEvents() 28: getNextEvent() 17 272829 23 24 25 26 30 32 3133 34 3635 40 3938 37 41 10 1819 42 44 10 Reusable Methods 8 New Methods 43 Use Case 4
10
February 19, 2009(c) Dr. David A. Workman10 Design Graph: 2 0: Main() Class Conversation 1: Conversation() 8: Initialize() 22: Insert() 44: Simulate() 45: WrapUp() 46: ~Conversation() Class Agent 2: Agent() 3: operator>>() 4: Get() 11: NameOf() 21: ~Agent() 23: oper<<() 26: Put() Class Student 5: Student() 6: Extract() 7: Get() 13: Initialize() 16: AcceptQuest() 24: Insert() 25: Put() 37: Dispatch() 39: doQuestion() 40: AcceptAnswr() 41: doAnswer() 47: ~Student() Class Players 9: Players() 12: setAgent() 14: getAgent() 15: getOther() 20: ~Players() Class Message 10: Message() 30: Oper<<() 31: Insert() 32: Put() 42: ~Message() Class SpeakMsg 17: SpeakMsg() 33: Insert() 34: Put() 38: getHandlr() Class EventMgr -3: EventMgr() 19: postEvent() 27: moreEvents() 28: getNextEvent() 48: ~EventMgr() 4645 47 Use Case 5 Class Event 18: Event() 29: oper<<() 35: getRecvr() 36: getMsg() 43: ~Event() 1 Reusable Methods 3 New Methods 21 Reusable 27 New ---------------- 48 Total Methods 4 Reusable 4 New --------------- 8 Total Classes
11
February 19, 2009(c) Dr. David A. Workman11 Scheduling Development Schedule Use Case 1 Use Case 3 Use Case 5 Use Case 4 Use Case 2 0: Main() 1 5 6 3 2 7 4 8 20 92 12 13 11 14 15 16 1710 18 19 21 2524222326 17 27 28 29 23 242526 30 32 31 33 34 36 35 40 39 38 37 41 10 18 19 42 44 43 46 45 47
12
February 19, 2009(c) Dr. David A. Workman12 Use Case Coverage Table ClassUse Case 1Use Case 2Use Case 3Use Case 4Use Case 5 ConversationConversation()Initialize() AgentAgent() ~Agent Operator>>() Get() NameOf() StudentStudent() Extract() Get() Initialize() AcceptQuestion() EventMgrEventMgr() postEvent() EventEvent() MessageMessage() PlayersPlayers() setAgent() getAgent() getOthers() ~Players() SpeakMsgSpeakMsg()
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.