Georgia Tech CSE 6730 Fall-2023 Modeling and Simulation Project
Live Demo
·
Taichi Demo
·
Taichi Code
.
├── src
# Render part
│ ├── components
│ │ ├── MyCanvas.tsx
│ │ ├── BoidsRenderer.tsx
│ │ │ ├── useFrame (update per frame)
# UI part
│ │ ├── ControlPanel.tsx
# Logic part
│ ├── models
│ │ ├── Bird
│ │ │ ├── index.ts
│ │ ├── Predator
│ │ │ ├── index.ts
│ │ ├── Obstacle
│ │ │ ├── index.ts
│ │ ├── Rule
│ │ │ ├── index.ts (Rule Base Class)
│ │ │ ├── Basic
│ │ │ │ ├── Alignment.ts
│ │ │ │ ├── Cohesion.ts
│ │ │ │ ├── Separation.ts
│ │ │ ├── Extented
│ │ │ │ ├── AvoidPredator.ts
│ │ │ │ ├── AvoidObstacles.ts
# State Management
│ ├── hooks
│ │ ├── useBoidsConfig.tsx
First, install dependencies:
npm install
Then, run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
-
Logic Part
- Three basic rules
- Alignment
- Cohesion
- Separation
- Boundless or Bouce off edge
- Speed limit
- Additional rules
- Direction noise
- Avoid Predator
- Avoid Obstacle
- Goal setting
- Predator/Prey Model
- Single Predator
- Multiple Predators
- Energy Model
- for predator, starvation makes it more aggressive
- for prey, starvation makes it more likely to be caught
- for prey, perching occasionally to rest and regain energy
- Three basic rules
-
Rendering part
- Use InstancedMesh and shared material to render boids (reduce draw calls)
-
More interative
- Adjust config through UI
- Next Frame button
- Soft Refresh
- Drag to move obstacle
- Mouse click concentration
-
Data/Simulation Analysis
- Simulate "Flocking" behavior with different rule weights
- Simulate "Avoid Predator" rule
- Simulate "Avoid Obstacle" rule
- How to measure the number of flocks
- Track the number of flocks over time
- Track the number of boids in each flock over time
- Track the alive rate of boids when a predator is present over time given birds flock or not
Molin Deng - @molin - [email protected]