SimEvents®Getting Started GuideR2015a
1 Introduction1-2SimEvents Product DescriptionModel and simulate discrete-event systemsSimEvents provides a discrete-event simulation engine and compo
5 Designing Paths for Entities5-10The three Set Attribute blocks assign a Type attribute to each entity, where the attributevalue depends on which ent
Select Arrival Path Using Input Switch5-11
5 Designing Paths for Entities5-12Combine Entity PathsIn this section...“Role of the Path Combiner” on page 5-12“Sequence Simultaneous Pending Arrival
Combine Entity Paths5-13• Connecting a feedback path: A feedback path enters the same queue as anordinary path.Sequence Simultaneous Pending Arrivals
5 Designing Paths for Entities5-14to be notified of the change is the first to advance an entity to the Path Combinerblock. The Input port precedence
Combine Entity Paths5-15Path Combiner Versus Input SwitchThe Input Switch block, described in “Select Arrival Path Using Input Switch” on page5-9, ha
5 Designing Paths for Entities5-16Model a Packet SwitchIn this section...“Overview” on page 5-16“Generate Packets” on page 5-17“Store Packets in Input
Model a Packet Switch5-17Generate PacketsThe packet switch example models each packet as an entity. The Time-Based EntityGenerator block creates enti
5 Designing Paths for Entities5-18Note: The entity does not actually carry a payload. This example models thetransmission of data at a level of abstra
Model a Packet Switch5-19The queue uses a FIFO queuing discipline, which does not take into account thedestination of each packet. Note that such a m
Discrete-Event Simulation in Simulink Models1-3Discrete-Event Simulation in Simulink ModelsSimEvents software incorporates discrete-event system mode
5 Designing Paths for Entities5-20This part of the example is similar to the model shown in “Use an Attribute to Select anOutput Port” on page 5-8.Con
Model a Packet Switch5-21• The priorities of the entity generation events. In this example, all Time-BasedEntity Generator blocks share the same Gene
5 Designing Paths for Entities5-22
6Selected Bibliography[1] Banks, Jerry, John Carlson, and Barry Nelson. Discrete-Event System Simulation,Second Ed. Upper Saddle River, N.J.: Prentice
1 Introduction1-4of time- and event-based modeling facilitates the simulation of large-scale systemsthat incorporate smaller subsystems from multiple
Related Products1-5Related ProductsIn this section...“Information About Related Products” on page 1-5“Limitations on Usage with Related Products” on
1 Introduction1-6What Is an Entity?Discrete-event simulations typically involve discrete items of interest. By definition,these items are called entit
What Is an Event?1-7What Is an Event?In this section...“Overview of Events” on page 1-7“Relationships Among Events” on page 1-7“Viewing Events” on pa
1 Introduction1-8not causally related to each other, the processing sequence can significantly affect thesimulation behavior. For an example, see “Cho
Run a Sample Model1-9Run a Sample ModelIn this section...“Overview of the Model” on page 1-9“Accessing the Model” on page 1-9“Examining Entities and
1 Introduction1-10Click Open This Example to open the model.Examining Entities and Signals in the ModelThis section describes the different kinds of p
Run a Sample Model1-11Entity connection lineEntityoutputportEntityinputportEntity connection lines represent relationships among two blocks (or among
How to Contact MathWorksLatest news:www.mathworks.comSales and services:www.mathworks.com/sales_and_servicesUser community:www.mathworks.com/matlabcen
1 Introduction1-12SignalconnectionlineSignaloutputportSignal input portIn a discrete-event system, the signal input port coming into a block changes t
Run a Sample Model1-13This block can process at most one job at a time and thus limits the availability of themicrocontroller to process new jobs. Wh
1 Introduction1-14
2Building Simple Models withSimEvents Software• “Build a Discrete-Event Model” on page 2-2• “Explore Simulations Using the Debugger and Plots” on page
2 Building Simple Models with SimEvents Software2-2Build a Discrete-Event ModelIn this section...“Overview” on page 2-2“Open a Model and Libraries” on
Build a Discrete-Event Model2-3Note: When you later create your own models, use the conversion blocks from theGateways library (gateway blocks) to co
2 Building Simple Models with SimEvents Software2-4Open Simulink LibrariesIn the MATLAB Command Window, entersimulinkThe Simulink Library Browser open
Build a Discrete-Event Model2-5Move Blocks into the Model WindowTo move blocks from libraries into the model window, follow these steps:1In the main
2 Building Simple Models with SimEvents Software2-63In the main SimEvents library window, double-click the Queues icon to open theQueues library.
Build a Discrete-Event Model2-74Drag the FIFO Queue block from the library into the model window.5In the main SimEvents library window, double-click
Revision HistoryNovember 2005 Online only New for Version 1.0 (Release 14SP3+)March 2006 First printing Revised for Version 1.1 (Release 2006a)Septemb
2 Building Simple Models with SimEvents Software2-86Drag the Single Server block from the library into the model window.7In the main SimEvents library
Build a Discrete-Event Model2-98Drag the Signal Scope block and the Entity Sink block from the library into themodel window.As a result, the model wi
2 Building Simple Models with SimEvents Software2-10Configure BlocksConfiguring the blocks in dd1 means setting their parameters appropriately to repr
Build a Discrete-Event Model2-113Click Cancel in both dialog boxes to dismiss them without changing anyparameters.The Period and Service time paramet
2 Building Simple Models with SimEvents Software2-12Then click OK. The Single Server block acquires a signal output port labeled #d.During the simulat
Build a Discrete-Event Model2-13Connect BlocksNow that the model window for dd1 contains blocks that represent the key processes,connect the blocks a
2 Building Simple Models with SimEvents Software2-14inappropriate for this particular example model, which is completely event-based andcontains no bl
Build a Discrete-Event Model2-15• Starting at T=1, the plot is a stairstep plot. The stairs have height 1 because theserver processes one entity at a
2 Building Simple Models with SimEvents Software2-16set_param('MyModel/Time-Based Entity Generator','position',[65 63 150 117]);Th
Explore Simulations Using the Debugger and Plots2-17Explore Simulations Using the Debugger and PlotsIn this section...“Explore the D/D/1 System Using
2 Building Simple Models with SimEvents Software2-18Functions | Help | Watch Video Tutorial%==========================================================
Explore Simulations Using the Debugger and Plots2-19Table of entities in the blockOne entityis in serviceEnd the SimulationThe simulation is still su
2 Building Simple Models with SimEvents Software2-20Enable the Queue-Length SignalThe FIFO Queue block can report the queue length, that is, the numbe
Explore Simulations Using the Debugger and Plots2-21Simulate with Different Intergeneration TimesBy changing the intergeneration time (that is, the r
2 Building Simple Models with SimEvents Software2-22First entitydeparts fromqueueEntity departsfrom queue, whichbecomes emptyOne entitydeparts fromque
Explore Simulations Using the Debugger and Plots2-235Reopen the Time-Based Entity Generator block's dialog box and set Period to 1.1.6Run the si
2 Building Simple Models with SimEvents Software2-241Double-click the FIFO Queue block to open its dialog box. Click the Statistics tab,set the Averag
Explore Simulations Using the Debugger and Plots2-258Run the simulation with different values of the Period parameter in theTime-Based Entity Generat
2 Building Simple Models with SimEvents Software2-26• The utilization of the server is nondecreasing if the intergeneration time is small(such as 0.3)
Explore Simulations Using the Debugger and Plots2-27• The average waiting time in the queue increases throughout the simulation if theintergeneration
vContentsIntroduction1SimEvents Product Description . . . . . . . . . . . . . . . . . . . . . . . 1-2Key Features . . . . . . . . . . . . . . . . . .
2 Building Simple Models with SimEvents Software2-28Information About Race Conditions and Random TimesOther examples modify this one by varying the pr
Build a Hybrid Model2-29Build a Hybrid ModelIn this section...“Overview” on page 2-29“Lesson 1: Run the Time-Based Model” on page 2-30“Lesson 2: Expl
2 Building Simple Models with SimEvents Software2-30• Use discrete events to update signals that influence time-based dynamics.• Adjust parameters in
Build a Hybrid Model2-31• ABS Controller subsystem that accepts a setpoint from the Desired Relative Slipblock and provides a control signal to the b
2 Building Simple Models with SimEvents Software2-32Lesson 2: Explore the Time-Based ModelBefore you modify the model to add discrete-event behavior,
Build a Hybrid Model2-33Desired Relative Slip BlockThe desired slip value is based on some physical modeling known as the mu-slip curve.The mu-slip c
2 Building Simple Models with SimEvents Software2-34Brake System Dynamics SubsystemThe Brake System Dynamics subsystem is complex. What follows is a h
Build a Hybrid Model2-35Sensor Relative Slip SubsystemThe Sensor Relative Slip subsystem contains a Gain block where you can specify theaccuracy of t
2 Building Simple Models with SimEvents Software2-36To learn about the Network Delay subsystem behavior and for instructions on buildingand integratin
Build a Hybrid Model2-37• Periodically, the Time-Based Entity Generator block creates an entity that conveysthe control signal value from the ABS con
vi ContentsMove Blocks into the Model Window . . . . . . . . . . . . . . . . . . . 2-5Configure Blocks . . . . . . . . . . . . . . . . . . . . . . . .
2 Building Simple Models with SimEvents Software2-38Add the Network Delay Subsystem ContentsIn this procedure, you add event-based blocks that model a
Build a Hybrid Model2-397Double-click the Get Attribute block. The Get Attribute tab of the dialog boxcontains a table. On the first row of the table
2 Building Simple Models with SimEvents Software2-407Connect the previously created Network Delay block between the ABS Controllerand Brake System Dyn
Build a Hybrid Model2-41• Between 6s and 8s, the measured slip increases and the wheel speed begins to lock up(decrease rapidly towards zero).• At ab
2 Building Simple Models with SimEvents Software2-42Event-Based and Time-Based Dynamics in the SimulationIn the abs_hybrid model, the time-based dynam
Key Concepts in SimEvents Software2-43Key Concepts in SimEvents SoftwareIn this section...“Meaning of Entities in Different Applications” on page 2-4
2 Building Simple Models with SimEvents Software2-44entities try and fail to advance along that same entity path. For example, an entitydeparts from a
3Create Entities Using IntergenerationTimes• “Role of Entities in SimEvents Models” on page 3-2• “Specify Intergeneration Times for Entities” on page
3 Create Entities Using Intergeneration Times3-2Role of Entities in SimEvents ModelsIn this section...“Create Entities in a Model” on page 3-2“Vary th
Role of Entities in SimEvents Models3-3• How the block determines the time intervals between successive entities. To learnmore, see “Specify Intergen
viiUse an Arbitrary Discrete Distribution as IntergenerationTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
3 Create Entities Using Intergeneration Times3-4Specify Intergeneration Times for EntitiesIn this section...“Definition of Intergeneration Time” on pa
Specify Intergeneration Times for Entities3-5Comparison of ApproachesUsing intergeneration times from a distribution might be appropriate if you have
3 Create Entities Using Intergeneration Times3-6f xx( ) =-< <ÏÌÔÓÔ1Maximum MinimumMinimum Maximum0 OtherwiseThe exponential distribution with me
Specify Intergeneration Times for Entities3-7Role of initial seed for uniform and exponential distributionsIf you set Distribution to Uniform or Expo
3 Create Entities Using Intergeneration Times3-8For more informationFor examples of how to create such signals, see:• “Use a Step Function as Intergen
Specify Intergeneration Times for Entities3-9Parameter Values Simulation Results• Distribution = Uniform• Minimum = 1• Maximum = 3The first entity, g
3 Create Entities Using Intergeneration Times3-10P tP tP t( ) .( . ) .( ) .DDD= == == =1 0 251 5 0 52 0 25When you run the simulation, the plot shows
Specify Intergeneration Times for Entities3-11• Step time = 2.8• Initial value = 1• Final value = 2As a result, the block generates a signal whose va
3 Create Entities Using Intergeneration Times3-12Entity Generation Time Intergeneration Time UntilNext Entity GenerationDeparture Time of Entity fromS
4Basic Queues and Servers• “Queues in SimEvents Models” on page 4-2• “Servers in SimEvents Models” on page 4-4• “Model Basic Queueing Systems” on page
viii ContentsSelect Arrival Path Using Input Switch . . . . . . . . . . . . . . . . . 5-9Role of the Input Switch . . . . . . . . . . . . . . . . . .
4 Basic Queues and Servers4-2Queues in SimEvents ModelsIn this section...“Behavior and Features of Queues” on page 4-2“Physical Queues and Logical Que
Queues in SimEvents Models4-3called a logical queue. For example, you might use a queue to provide a temporarystorage area for entities that might ot
4 Basic Queues and Servers4-4Servers in SimEvents ModelsIn this section...“Behavior and Features of Servers” on page 4-4“What Servers Represent” on pa
Servers in SimEvents Models4-5• A person (such as a bank teller) who performs a transaction with each arrivingcustomer• A transmitter that processes
4 Basic Queues and Servers4-6Model Basic Queueing SystemsIn this section...“Constructs Involving Queues and Servers” on page 4-6“Example of a Logical
Model Basic Queueing Systems4-7on an entity before the second server is available, the entity must stay in the first serverpast the end of service an
4 Basic Queues and Servers4-8Serial Connection of QueuesTwo queues connected in series might be useful if you are using entities to model itemsthat ph
Model Basic Queueing Systems4-9a jammed exit ramp of the freeway. You might model the tollbooth as a server and thetraffic jam as a gate.Example of a
4 Basic Queues and Servers4-10Determining the proportion of time the physical queue length exceeds 10 is equivalent todetermining the proportion of ti
Model Basic Queueing Systems4-11• You want the service time to arise from dynamics of the simulation. In this case, setthe Single Server block's
1Introduction• “SimEvents Product Description” on page 1-2• “Discrete-Event Simulation in Simulink Models” on page 1-3• “Related Products” on page 1-5
5Designing Paths for Entities• “Role of Paths in SimEvents Models” on page 5-2• “Select Departure Path Using Output Switch” on page 5-5• “Select Arriv
5 Designing Paths for Entities5-2Role of Paths in SimEvents ModelsIn this section...“Definition of Entity Paths” on page 5-2“Implications of Entity Pa
Role of Paths in SimEvents Models5-3model below shows two queues in a parallel arrangement, preceded by a block that hasone entity input port and two
5 Designing Paths for Entities5-4Other libraries in the SimEvents library set contain some blocks whose secondaryfeatures, such as preemption from a s
Select Departure Path Using Output Switch5-5Select Departure Path Using Output SwitchIn this section...“Role of the Output Switch” on page 5-5“Sample
5 Designing Paths for Entities5-6The topics listed below illustrate the use of the Output Switch block.Topic Features of Example“Select the First Avai
Select Departure Path Using Output Switch5-7This deterministic model creates one entity every second and attempts to advance theentity to one of two
5 Designing Paths for Entities5-8Use an Attribute to Select an Output PortConsider the situation in which parcels are sorted among several delivery ve
Select Arrival Path Using Input Switch5-9Select Arrival Path Using Input SwitchIn this section...“Role of the Input Switch” on page 5-9“Round-Robin A
Komentarze do niniejszej Instrukcji