Sharad Cornejo Altuzar

DirectX Projects

Workflow Behavior Simulator

Program developed to test interaction between different technologies: DirectX, WPF, Windows Workflow and Windows Communication Framework.

It is an agent AI Peer to Peer simulator. Each program can choose between different AI Modules that change the behavior of the agent. There are 3 different behaviors: Walk randomly, Walk in a Square and Flock.

  • Walk Randomly just chooses a random direction each step and moves the agent in that direction. The agent respects the simulation bounds.
  • Walk in a Square does just that. Makes the agent walk following a square pattern
  • Flock instanciates 8 agents that walk following a flocking behavior driven by the rules developed by Craig Reynolds: Separation, Alignment and Cohesion.

The AI of the agents can be driven by different modules: Regular C# logic (Flocking) or a Windows Workflow model (Walk randomly and walk in a square).

The program follows a Model-View-Controller pattern:

  • The View is our Direct3d Managed C++ Module and it's responsible for displaying our model.
  • The Controller is a WPF application that hosts the D3D Viewer as an Interop D3DImage, updates the model for the current program, gets the messages sent from other peers, posts the messages from our updated model and updates the Viewer.
  • The Model is our AI simulator.  Each Model implementation shares 2 common interfaces: IAgent (for its agents) and ISimulate (for the actual simulation). As long as they implement this interface they can be called by the controller.

Each client communicates with other clients in a Peer to Peer fashion through WCF.


High level Design Diagram Thumbnail Workflow 3.0 Logic Thumbnail Flock of Aliens
Workflow 4.0 Logic Thumbnail Running the workflow Thumbnail