SIMEVENT predefined attribute generation

2 次查看(过去 30 天)
Hi given a matrix A
A = [1 2 7 5 6 6 7 8 5 3 4 2 1 3 5 6; 1 6 1 1 1 2 7 9 5 3 2 2 3 3 4 6; 3 1 3 6 8 2 7 9 5 3 4 2 2 5 5 6]
I want to generate 3 different simulation where the entitities at each simulation acquire the attribute given by each row. So the in the first simulation the entities should acquire attribute values equal to the first raw: the first entity generated must have attibute=1, the second entity generated must have attribute=2, the third entity generated must have attribute = 7, the fourth entity generated must have attribute= 5 and so on...
Does someone know how can I obtain this in SIMEVENT, starting from a predefined matrix in matlab ?
  1 个评论
Renato SL
Renato SL 2019-9-9
I have tried something with an example that I'm working on.
I put a vector of values defined in the workspace as the Vector of output values of a Repeating Sequence Stair block. Then, the output of the block is connected to a Simulink function (say, assign_attribute() ). Then inside the Entity Generator, I set the entities to have the attribute attr1, and in the Event Actions tab -> Generate, I put entity.attr1 = assign_attribute().
Maybe Repeating Sequence Stair is not the right block for what you want, but I think the overall method should be similar.

请先登录,再进行评论。

回答(1 个)

Zenin Easa Panthakkalakath
Hello Luca,
Have you tried Simulation Manager? I find that the content in the following blog post aligns with the described requirement.
As you can see in the blog, you can programmatically assign the block parameters and run the simulations parallely using 'parsim'. Best part is that you can open up the model with different sets of parameters from Simulation Manager UI whenever required.
Regards,
Zenin

类别

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