Simulation and Modeling

Assignment 5: Animator for Process Interaction Simulation

 

Objective:
To design an Animation for the Simulation Engine written for Process Interaction. Starting from assignment 4, build an Animation Engine.

Description:
Build a animation engine that takes commands (AnimateCommand) from a simulation engine. Place the commands in a shared queue (LinkedBlockingQueue<AnimateCommand>). The simulation engine places animation commands on the shared queue, while the animation engine takes commands off the queue. Commands include adding and removing animation object (shapes) as well as translating, rotating, rescaling and changing the appearance of these objects. The animator should have its own animation clock that is advanced as animation commands are processed. Its display thread will iteratively process pull a command from the shared queue, determine the delay for this command, sleep that amount of time and then carry out the command.


Extending Assignment 4:
Based on the process interaction approach explained in next section, design a simulation engine. Assignment is divided into three parts as follows:

Program should be well commented and all three applications should be in different files.

Process Interaction/Orientation:

Process is the life cycle of one entity. Analyst defines simulation model in terms of entities and their life cycles. These entities may use different resources from the system whose capabilities are limited. This causes these entities to interact with each other. For example, an entity forced in a queue because the required resource is busy with another entity. Thus process is time-sequenced list of events, activities and delays. Refer section 3.1.2 for details on this topic.

This process oriented view implies that engine must support separately schedulable threads for every user or customer or entity. Section 14.2.1 talks about how to use threading. Each thread will represent one entity. If one entity is using a resource and another wants to use the same, it should be put in queue until first one finishes. This requires thread to wait and then go further when resource is available.

Also read section 4.6 for a more background.