Generating many entities upon arrival of one entity in SimEvents

Generating many entities upon arrival of one entity in SimEvents

Post by Taha » Thu, 12 Mar 2009 00:50:20


Hi,

I would like to know if there is an easy way to generate several entities upon the arrival of one entity in SimEvents.

Many thanks in advance!

~T
 
 
 

Generating many entities upon arrival of one entity in SimEvents

Post by Devdatt La » Thu, 12 Mar 2009 02:02:13

Hi Taha,

The SimEvents demo "Variable Entity Replication" might give you some ideas
on how to get started with this task.

Also check out the use of the "Entity Departure Event to Function-Call
Event" block in the SimEvents Event Translation library. This block can
generate function-calls upon the arrival of an entity. You can use this
function call to start the process of generation of multiple entities.

Hope this helps,
Devdatt

--
Devdatt Lad
The MathWorks, Inc.

 
 
 

Generating many entities upon arrival of one entity in SimEvents

Post by Taha » Thu, 12 Mar 2009 16:56:01

Thanks DevDatt,
Is there a specific example on how to use the "Entity Departure Event to Function-Call Event" block to generate many entities upon the arrival of another one. The arriving entity and the generated ones are of different nature in my model. Also, using the entity replication block is not the best option for me because I need to create about 1000 entity upon the arrival of one. I will need a block with a 1000 outputs!!!

Many thanks for your help in advance!

~T
 
 
 

Generating many entities upon arrival of one entity in SimEvents

Post by Amanda Gal » Thu, 12 Mar 2009 21:36:44

i Taha,

There might not be a single ready-made example that does exactly what you want
to do. However:
a) The demo that Devdatt mentioned illustrates how to use a looping technique to
create lots of entities (such as 1000) without having to create that number of
output ports.
b) The "Multitasking with Dependent Tasks" demo includes an Entity Departure
Event to Function-Call Event block that connects to an Event-Based Entity
Generator to create one entity upon the arrival of another one. You'll need to
open the "Dependent Task Generator with Lowest Priority" and "Plots and
function-call for dependent tasks" subsystems to see those two blocks because
they're not at the top level of the block diagram.

Can you try combining the two ideas in your model and see if it meets your
needs?

Another approach you might want to try is to configure a Discrete Event
Subsystem block to act as a kind of event multiplier, in the sense that for
every event that causes the subsystem to execute, the subsystem outputs 1000
simultaneous function calls that you can feed into the Event-Based Entity
Generator block to generate 1000 entities. Inside the subsystem, connect the Din
inport to a Terminator block and connect the Dout output port to a Function-Call
Generator block from the Simulink Ports & Subsystems library. The Function-Call
Generator block should have Sample time set to -1 and Number of iterations set
to 1000. At the top level of your model, connect a signal to the Din port of the
subsystem that will cause the subsystem to execute every time an entity passes
through -- such as a #d output signal from a block that processes entities.

HTH,
Amanda


"Taha " < XXXX@XXXXX.COM > wrote in message
news:gp7qqh$5fi$ XXXX@XXXXX.COM ...