My Problem is having to work with real-time server in a DES model. I have the following situation:
I want to build a discrete event simulation model (Using event scheduling world view). However, this model needs to be connected to another real-time program.
Within this model, the event routines create next events based on the answer, that the model gets from a 3rd Party software. In better words, the model needs to make a TCP/IP connection to a server at the beginning and generate next events based on the answers which it receives from the other program.
As an example: The model executes event A and within its event routine code, there will be a TCP/IP call to a server which asks "Should I generate the event B or C?". Assume the answer from the server is B, an event of type B will be generated, and so on. Based on my knowledge, the simulation model has a virtual time, which it shifts to the next event time in the event list, upon executing the current event.
Now imagine the following scenario:
Event A (event time: 11:00:00) & B (event time: 11:00:01) are on the event list. Event A gets to be executed first, virtual simulation time is now 11:00:00. It makes a call to the server to find out which event to generate next. The Server takes 2 seconds to answer.
How should the virtual time of model be shifted?
- If I consider that 2s delay and shift the virtual time to 11:00:02, the event B will be overpassed (See Edit). But the clock will be the same as it would be in a real-world system.
- If I ignore this 2s response time, the model will shift the clock to 11:00:01 and execute event B, although the time in the real-world scenario is now 11:00:02. This means, the model does not behave similarly to the real-world.
I was wondering if someone can guide me to the right direction? How should I deal with the real-time scheduling issue of the DES model? I tried searching online and in literature, but I found nothing which seems to be the solution to my problem. I would appreciate it if anyone can tell me where I can find some useful material on this matter.
Edit: By "overpassed" I meant the event will be skipped by the simulation model and not get executed because the simulation time will be set to 11:00:02 which is later than 11:00:01 (execution time of event B). In real world, System does event A and sends a request to server at 11:00:01 and while waiting for the server response for event A, goes on and executes event B on the next second. Later when the response for A is there, it will then decide which event to put on event list. Can't figure out how this "waiting for response from server while executing the next event" could be modelled.