Creating multiple time entities from a single SimEvents entity generator

조회 수: 3 (최근 30일)
John F
John F 2012년 12월 3일
I am trying to build a CAN bus simulation with multiple messages. The message list may change in size depending on the program. I can initialize the message list and sizes in the workspace prior to running the simulation.
What I'd like to do is have one Time-Based Entity Generator generate more than one CAN message (i.e., entity). The intergeneration times for each entity will be different. I'm trying to input a vector of times, and every time I do, I get an error saying the time must be a scalar.
Is it possible to do what I'm thinking? Thanks!
  댓글 수: 1
John F
John F 2012년 12월 11일
Perhaps I should rephrase the question. Can a time-based entity generator generate multiple entities at the same time at different rates? Can it be vectorized like any other Simulink block? I do not want a sequence of entities. I need them to come out in parallel. Does that make sense?

댓글을 달려면 로그인하십시오.

답변 (1개)

Devdatt Lad
Devdatt Lad 2012년 12월 3일
In the Time-Based Entity Generator block, set the "Generate entities upon" parameter to be "Intergeneration time from port t". Now you can use an Event-Based Sequence block to feed in a vector of intergeneration times. If you want multiple simultaneous entities at a given time, then use 0 as the intergeneration time, e.g. [1 1 0 0 0 1] will generate entity at T = 0,1,1,1,1,2.
  댓글 수: 3
Chetan Rawal
Chetan Rawal 2012년 12월 4일
I do not see why not. If you feed the entities into the SET ATTRIBUTE block, you should be able to set values for simultaneous entities simultaneously. This is where the beauty of event-based SimEvents comes out.
Chetan Rawal
Chetan Rawal 2012년 12월 20일
You can also try to use this: -Set Attribute for one entity. -Split the entity using the "Entity Splitter" block under Entity Management library; this should give you multiple entities with the same Attribute values.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Discrete-Event Simulation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by