SimEvents - inheritance & relative references & resource control

1 次查看(过去 30 天)
Hi,
I am currently evaluating a few different pieces of software for capability/ease of use in building DES models, and as I already had access to SimulLink I thought I would give SimEvents a go! While I have been looking through some of the introductory tutorials, I still have a few important questions about how the software structures its models that I haven't been able to find so far:
  1. Does SimEvents have any semblance of inheritance for model building, i.e. I have 5 servers that should all share the same block of code to calculate process time. If I was to change the code, can I do it in a single place and have the changes trickle down or will I have to change the attributes on each processor block?
  2. If I am at an event in a queue and I want to route out to one of multiple processors, how can I reference the attributes and state of each processor that I could route to (e.g. a successor attribute from the queue that I can use)?
  3. When I have 4 workers with different combinations of 3 skills, how could this be easily set up such that a server block can request say 2 of skill A and 1 of skill B? Would I need to essentially create all of the skill combinations that are possible and feed the request into the right combination, while tracking which workers are engaged where?
Apologies if these are simple questions, but after a lot of searching I still can't find a clear answer to them!
Thanks!

采纳的回答

Abdolkarim Mohammadi
编辑:Abdolkarim Mohammadi 2021-6-25
1. MATLAB Discrete-Event System (MDES) block allows you to share code between multiple instances of an object, where each block can have different properties in the run time. For example, all of your servers share a single file of code, and at the same time, each of them can have different service time, defined in a dialogue box, similar to standard SimEvents blocks.
2. Prior to each router (or Entity switches in SimEvents) you can have a server, whose job is to set the route for the entity to be directed in the switch block as an attribute. You can also do this without separate block, and implement this in as the service completion event action (but not the exit action) of the normal servers to reduce the numer of blocks.
3. Each skill should be modeled as a separate resource pool. When an entity arrives in the Resource acquirer block, it waits until all of the resources needed are available.
As a concluding remark, SimEvents is ultimately flexible. If you master it, especially the MDES, you can simulate any discrete-event system. I encourage you to put time and effort to learn SimEvents.
  2 个评论
Matthew Gilbert
Matthew Gilbert 2021-6-28
Thanks for your answer. A few more questions based on your response:
  1. So you would essentially be maintaining inheritance through custom object code blocks? For example, I could have a 'Processor' object that is derived from the MDES block, then I could derive a 'Work Bench' object from the 'Processor' object, and instantiate the 'Work Bench' object in the model? If so, if there any way to navigate this tree? For example, in the model, I may want to loop through all 'Processor' objects, or navigate from one 'Work Bench' object, up to the class object, and back down to a different 'Work Bench' object.
  2. Perhaps my example was a little misleading - I am interested in how I could reference the attributes of other objects in the model from a given starting point. For example, I may want to do some actions in processor 1 based on the attributes (or content's attributes) of processor 2 elsewhere in the model. How would I be able to access the processor 2 attributes from an event within processor 1 without knowing the direct model path of processor 2 (e.g. I may know that it is the object 2 connections after my current object)? It may be that I just need to maintain a common list of the model structure somewhere for easy access, but I am looking to see if something already exists for simple relative referencing.
  3. So in order to implement my example before where each resource can fulfill a set of skillsets, and it is the skillsets we request, I would need to manage that say 1 resource in pool A actually represents another resource in pool B and ensure the counters reflect the actual number of available resources?
Thanks a lot for your help!
Abdolkarim Mohammadi
1. I don't for sure whether discrete-event system can be inherited or not.
2. The logic behind SimEvents' blocks is the Entity/Storage system. Storages located in different blocks cannot communicate directly with each other (maybe with the help of Data store or other blocks). All of the blocks of the standard library of SimEvents have only one storage. Therefore, they cannot communicate with each other. In MDES block, you can create many storages in your block, the main benefit of which is the ability of the storages to communicate with each other. Communication means passing data and more importantly, triggering event actions on each other.
3. As far as I know, you cannot do this in SimEvents' standard Resource pool. You need to virtually create the resource pool as a property of the MDES. Then you can control how to forward entities to other blocks.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Discrete-Event Simulation 的更多信息

标签

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by