English 中文(简体)
Time Independent Discrete Event Simulation [closed]
原标题:
Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 3 years ago.

I am trying to design a discrete event simulation where the execution of an event is independent of time. Choosing what event comes next is dependent only on the conditions of the model (in my case, a person), and they re executed one at a time.

I have found a couple of designs out there:

  • Event Scheduling - A queue of events is kept and during each event execution, new events are scheduled or old ones cancelled.

  • Activity Scanning - During each cycle, all the events are iterated through, and if the current state of the person satisfies the event s conditions for execution, that event is executed.

  • Graph of Events - Have a graph of events, and have each edge represent the conditions of the transition.

The considerations I have for each of the methods are the following:

  • Event Scheduling - The logic of what event should be added is distributed across the events, making it hard to keep track of. Moreover, the queue would get changed a lot, and because it s not time based, you d have to iterate through the entire queue each time you want to make changes to find the event(s) to remove (for example, if you wanted to remove event B when preceded by two event A s).

  • Activity Scanning - The performance of it could be bad, especially if it has to iterate through many events to find the next one to execute during each cycle.

  • Graph of Events - If the graph is extremely large, initializing it and setting up all the edges could become cumbersome.

I wanted your opinions on which method might be the most suitable, and if so, in what ways I could address the considerations stated. Maybe a completely different design might be appropriate.

问题回答

You could try the Javascript Discrete Event Simulation library at http://www.simjs.com. It supports event-scheduling and discrete time flow. You can schedule "events" for the future or have them wait on some predicate, and register callback functions which will be called when the (simulated) time has reached the deadline or the predicate is satisfied.

You question is not very clear to me, but I think that you could use a discrete event simulation system and ignoring time component. You can schedule all events right now and it should work independetly of time domain. I am using SimPy http://simpy.sourceforge.net/ and IMO it is capable of it.

I would recommend looking into Petri Nets. They are widely used for business process modeling and they do not need time. the colored petri nets can represent time as well if needed. and stochastic Petri-nets can also address randomness and time. this is a definitive introduction to what they are, and what they can do.

http://www2.ing.unipi.it/~a009435/issw/extra/murata.pdf

there are tons of packages for them in different languages and you can develop your own using their algebraic methodologies for fast implementation.





相关问题
Collision Detection between Accelerating Spheres

I am writing a physics engine/simulator which incorporates 3D space flight, planetary/stellar gravitation, ship thrust and relativistic effects. So far, it is going very well, however, one thing that ...

Terrarium-like agent interaction framework

I m looking for a framework for agent interaction simulation, where I can deploy some agents and let them interact and watch their evolution. Until now I found Terrarium 2.0 (http://terrarium2....

coachable players for RoboCup Soccer Simulator 2d v14

I am doing a work similar to this one but the coachable players i found online are 3 years old and don t work with the latest version of the soccer server. does anyone know any alternatives? or have ...

3D Engine for Driving Simulation [closed]

Is there any open-source 3D graphics and physics engine specialized in driving simulation? Something like a configurable game engine targeted at games that involve driving, or something more ...

热门标签