Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added ATDS.mp3
Binary file not shown.
38 changes: 4 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,10 @@
# BioCrowds
Biocrowds is a crowd simulation algorithm based on the formation of veination patterns on leaves. It prevents agents from colliding with each other on their way to their goal points using a notion of "personal space". Personal space is modelled with a space colonization algorithm. Markers (just points) are scattered throughout the simulation space, on the ground. At each simulation frame, each marker becomes "owned" by the agent closest to it (with some max distance representing an agent's perception). Agent velocity at the next frame is then computed using a sum of the displacement vectors to each of its markers. Because a marker can only be owned by one agent at a time, this technique prevents agents from colliding.

## Agent Representation (15 pts)
Create an agent class to hold properties used for simulating and drawing the agent. Some properties you may want to consider include the following:
- Position
- Velocity
- Goal
- Orientation
- Size
- Markers
# The Framework Writup

## Grid/Marker Representation (25 pts)
Markers should be scattered randomly across a uniform grid. You should implement an efficient way of determining the nearest agent to a given marker. Based on an marker's location, you should be able to get the nearest four grid cells and loop through all the agents contained in them.

## Setup (10 pts)
- Create a scene (standard, with camera controls) and scatter markers across the entire ground plane
- Spawn agents with specified goal points

## Per Frame (35 pts)
- Assign markers to the nearest agent within a given radius. Be sure that a marker is only assigned to a single, unique agent.
- Compute velocity for each agent
- New velocity is determined by summing contributions from all the markers the agent "owns". Each marker contribution consists of the displacement vector between the agent and the marker multiplied by some (non-negative) weight. The weighting is based on
- Similarity between the displacement vector and the vector to agent's goal (the more similar, the higher the weight. A dot product works well)
- Distance from agent (the further away, the less contribution)
Each contribution is normalized by the total marker contributions (divide each contribution by sum total)
- Clamp velocity to some maximum (you probably want to choose a max speed such that you agent will never move further than its marker radius)
- Move agents by their newly computed velocity * time step
- Draw a ground plane and cylinders to represent the agents.
- For a more thorough explanation, see [HERE](http://www.inf.pucrs.br/~smusse/Animacao/2016/CrowdTalk.pdf) and [HERE](http://www.sciencedirect.com/science/article/pii/S0097849311001713) and [HERE](https://books.google.com/books?id=3Adh_2ZNGLAC&pg=PA146&lpg=PA146&dq=biocrowds%20algorithm&source=bl&ots=zsM86iYTot&sig=KQJU7_NagMK4rbpY0oYc3bwCh9o&hl=en&sa=X&ved=0ahUKEwik9JfPnubSAhXIxVQKHUybCxUQ6AEILzAE#v=onepage&q=biocrowds%20algorithm&f=false) and [HERE](https://cis700-procedural-graphics.github.io/files/biocrowds_3_21_17.pdf)

## Two scenarios
- Create two different scenarios (initial agent placement, goals) to show off the collision avoidance. Try to pick something interesting! Classics include two opposing lines of agents with goals on opposite sides, or agents that spawn in a circle, which each agent's goal directly across.
- Provide some way to switch between scenarios

## Deploy your code! (5 pts)
- Your demo should run on your gh-pages branch
My BioCrowds implementation basically contains a bunch of markers that are distributed across the plane. Here the plane is divided into a grid of a total of 25 cells where each cell holds 100 markers each. The Agents are positioned at the ends in both the scene and they randomply pic one of the poles as their goal in which case the goal changes its color to the color of the Agent. The Agents cross over from one side of the plane to the other side trying to reach their goal by acquiring markers along the way that are used to calculate the velocity of the Agents in the direction of the goal. The velocities of each Agent is updated per frame. The markers are assigned to each agent based on the closes Agent getting the marker and the process is optimised by only considering the cells that are around the marker position are considered and their markers are checked gainst the Agents.

## Extra credit
- Add obstacles to your scene, such that agents avoid them
There is a probalistic chance that an obstacle will show up on the plane in which case the Agents will have to avoid the obstacle and reach the other end. But, this implementation has a minor limitation that in certain cases when the markers are sparce or unavailable or the Agent is in the center of the obstacle then the agent only gets markers that are behind it in which case it does not have any marker contributing in its velocity towards the goal and it stops moving. I have tried fiddeling with the weighting construct I am using or adding some velocity along the goal regardlesss of the markers owned and a few other ways but they all turned out to be inconsistent and unreliable in handeling all the endge cases correctly.
I have left the functionality in the implementation and it will create an obstacle but it might be that the some Agents may get stuck.
Binary file added adam.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added adam1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added adam2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added explosion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gif_particle_convergence.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>HW1: Noise</title>
<style>
html, body {
margin: 0;
overflow: hidden;
}
canvas {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<audio id="myAudio" src="ATDS.mp3"></audio>
<script src="bundle.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions node_modules/.bin/acorn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/babylon

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/errno

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/gasket

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/gh-pages-deploy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/jsesc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/loose-envify

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/mkdirp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/ncp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/ndjson

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/npm-execspawn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/regjsparser

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/rimraf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/sha.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/uglifyjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/webpack

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/webpack-dev-server

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

212 changes: 212 additions & 0 deletions node_modules/accepts/HISTORY.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions node_modules/accepts/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading