Jeel Shah
Jeel Shah

Reputation: 3334

Pedestrian Simulation Java

I recently watched this video and got interested in replicating what is shown. The main problem I am facing is deciding on how to start. I have a few ideas but I am not sure if they are correct or even remotely correct. The comment by the person who posted the video indicates the use of Calculus, which I have not taken yet (mind you, I am only in high school). Furthermore, the user has given the code in python but I am not efficient in python to understand it deeply.

Here is my idea:

  1. Build a class that represents one "person"
    1. Class will contain a method that "sprays" "particles" to indicate its position
    2. A check method that looks around for other persons and adjusts it position
  2. The main class that will setup the initial positions of the persons and start the program

As you can see the plan is not very detailed but will this idea work? And if not, what are routes that I can take to do this?

Thanks!

Upvotes: 0

Views: 341

Answers (1)

Mirko Adari
Mirko Adari

Reputation: 5103

Start with your primary environment - graphics. There are subtle wrappers around OpenGL like LWJGL and also full-blown game engines like jMonkeyEngine. If you follow their tutorials it will become quite clear how to map your domain to objects and render them based on the simulation.

As for the simulation idea, that's why I love OOP - you think in terms of human behavior and map that directly into objects and their behavior (methods). So your idea should definitely work. Sorry for such a general answer, but it's equal response to a general question.

Upvotes: 1

Related Questions