Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Consider the need to simulate a set of entitities in an accurate way. All entities exist in an artificial timeline. Within 'steps' of this timeline, all entities can do certain operations. It is imperative that timed events, are handled accurately, and not in processing order. So simple threading isn't a proper simulation, nor is procedurally walking across all entities.

Processing may be slow, accuracy is key here.

I have some ideas how to implement this myself, but most likely something like this has been done before.

Are there any frameworks available for these purposes? Is there any particular paradigm more suitable?

UPDATE: example for clarification

Example: A and B send C a message at the exact same time. Assume sending the message takes time based on distance, and they both are at the exact same distance from C. C should be able to handle this action as a simultaneous 'event', not based on processing order if A would be traversed before B.

share|improve this question
    
Interesting, do you have a particular language in mind? Do you also need to simulate these entities failing to do what is expected? –  Tim Post Feb 24 '11 at 19:25
1  
Why do you think that procedurally walking all entities doesn't do as you expect? It's straightforward to manage simultaneity by just having all entities react to the state at the start of the timestep, regardless of what other entities have had their current timestep simulated yet. –  Anon. Feb 24 '11 at 20:41
    
I don't have any idea what you are talking about. What does handled accurately mean. What does processing order have to do with accuracy? How has is threading or procedural walkthroughs related to anything. –  Pemdas Feb 25 '11 at 0:25
2  
It would help people answering your question immensely if you could give a concrete example. This should include how entities interact with each other to illustrate the difficulty in managing dissemination of information outside of the timeline. –  Gary Rowe Feb 25 '11 at 8:57
1  
you need to provide more information about what you're trying to do before we could suggest actual methodologies. I'd like to suggest flame.ac.uk but, you haven't really said enough for me to determine if it's anything like what you want. –  TZHX Feb 25 '11 at 9:01
show 1 more comment

3 Answers

up vote 1 down vote accepted

this sounds like a discrete-event simulation

you have a schedule of events by an arbitrary number of entities; at each time 'tick' an entity may take one or more actions including scheduling more actions at future time ticks

the main processing loop just walks through the timeline, jumping to the next time tick where an action is scheduled

the unclear part of this is what is the significance of (in your example) having C handle the message from A first and then B or somehow interleaving the two? If C's response to each message is another series of discrete events, then C can just schedule the responses for A and B as a set of future discrete events.

rinse and repeat

share|improve this answer
add comment

You may have a look at the Verilog and VHDL simulation languages. If you can model your setup in these languages, then good simulators are available. You can have text file input and output to drive and monitor your model.

share|improve this answer
2  
Warning though, AFAIK these languages are meant for designing digital hardware. Might not be suitable for your simulation. –  apoorv020 Mar 28 '11 at 12:06
add comment

I'm using a tool called DEVS-Suite for some research in scalable queuing. In its own words:

DEVS-Suite is a Parallel DEVS simulator with support for (i) automating design of experiments in combination with (ii) animating models and (iii) generating data trajectories at run-time. See CoSMoSim - it offers rich visual modeling, database, etc.

(DEVS is an acronym for Discrete Event Simulation Specification).

It does take some time to figure out how to use, and while it is documented, the documentation does not tell you everything. On the other hand, the basic framework is stable.

The project home page is at: http://devs-suitesim.sourceforge.net/, and contains a bibliography of several papers describing it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.