Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread and simulation

 
danesh far
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to simulate a footbal game which is a part of my project in the field of Opponent Modeling and its application in robocups.As you know we have 22 players and at any time they have to do something based on the their duty and position such as catch the ball ,shoot the ball and ...
How could I do that in JAVA.I already simulate a player and a goolkeeper is using Thread technic.In this simulation first goalkeeper moves and according to its position, the player move. What should I do if I have 23 different agents (22 players +ball)in a game and if everyone have to make a decision based on their mind (using some local information.Is there anyone who is interested to contribute in this project ?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just thinking out loud ... if you have a thread for each player you are not guaranteed they will get a fair share of processor time. One player might stand there unable to respond to anything happening around hime while another runs for a goal.

"Life" game implementations use two copies of the playing board. So maybe each player makes a decision where to go based on the current board and puts himself in the new position on the new board. You'd have to deal with collisions of course - maybe allow multiple players in one square but one stays up and the others are "knocked down". The advantage is for a single virtual time click - faster or slower than real time - you move everybody. Nobody gets starved for time slices.

Any of that help?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic