> On Apr 30, 2017, at 1:30 PM, Vityou <zlee...@gmail.com> wrote:
> 
> I am working on an ant colony simulation/game/thing.  Right now I'm using 
> 2htdp/universe and 2htdp/image and the racket language.  To represent an ant, 
> I made a struct with a position, angle, and carrying-food?.  To test the 
> speed of the simulation I made a new ant with a random angle on every clock 
> tick of big bang (my world state is a structure that holds a list of ants and 
> various other things like pheromones, food, etc.).  However, when there were 
> about 250 ants on the screen, it started to slow down a lot.  Not rendering 
> sped it up somewhat but not by much.  I was confused by this because in 
> python I had made a similar simulation with 5000 objects and it didn't seem 
> so slow down very much.  Is there anyway to make it faster?  Thanks for any 
> help.


You should probably replace 2htdp/universe and /image with racket/draw and 
racket/gui. And I should probably write a chapter on how to do so 
systematically. 

[[ These teaching libraries are written in a purely functional style and with 
tons of checks so that if something goes wrong, which always does for 
beginners, the error messages are good. The price you pay in performance is a 
large factor. ]] 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to