Download presentation
Presentation is loading. Please wait.
Published byBrittney Jefferson Modified over 9 years ago
1
Crowd Dynamics AI Engine w/ PSO By: Keith Ainsworth Pd. 5
2
Crowd Dynamics AI in C++ ● Using a game for demonstration ● C++ with Object Oriented Programming ● SDL for graphical Display (might become OpenGL)
3
The AI: ● Crowd Dynamics ● Simulates the motion, movement, behavior of groups ● Conventional games do it individually ● Simple example: A group of people finding a target ● Particle Swarm Optimization
4
PSO ● A method to optimize the behavior of “swarms” ● Conventionally used in anthill simulations ● This only optimizes half of my AI engine ● Optimizes the movement calculations ● Does not optimize the communication aspect
5
Current Class Structure: Person PNetworkWorld weight_list
6
● Looping, array-based, fixed-size container ● 2 lists, one for data, one for weighting in summation ● Summation functions, which return the average value of the list (taking weighting into consideration) ● Used by the PNetwork to pick a direction for a person to travel after receiving a bunch of tips from the other people
7
Pnetwork ● Instantiated with a list of people as the group ● Each time the step() method is called it Calls the “communicator” method of each person Adds them all into a weight_list for each person (differentiated by the weightings given) Instructs the persons to travel in the direction of the summation of their weight_list
8
Simulation: ● Shows Regular Simulation
9
Subclassing Structure ● Program Built around base libraries which can be subclassed ● Classes include: World (subclass: ngon_world) Std_Person (subclass:theta_person, subclass of person)
10
ngon and ngon_world ● ngon is a class that essentially stores a polygon of n sides through the boundary points ● Can be concave, convex, even internally intersecting ● ngon_world is a subclass of world, which maintains the “global” variables to the simulation ● The subclass allows for obstructions in sight and movement of agents in the form of ngons
11
R_Limit.hpp ● The simulation wasn’t regular in it’s behavior in human/computer interaction ● Different computers = Different Difficulties ● This is a rate limiting library Utilizes time.h system functions for maximum portability and accuracy Two methods, queue() and hold(). Queue is called before the frame’s codes, hold is called at the end and holds if necessary to maintain a rate. Slows a simulation to a rate but cannot speed it up to a rate it isn’t maintaining.
12
ngon_world
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.