swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speed decrease between 2.0 and 2.1?


From: Marcus G. Daniels
Subject: Re: Speed decrease between 2.0 and 2.1?
Date: 23 May 2000 09:41:10 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "DC" == d e cox <address@hidden> writes:

DC> The code is there as: traffic-0.3.tar.gz

This should get much of the performance back.  Say, a factor of four...

diff -c -r traffic-0.3/ModelSwarm.m traffic-0.3a/ModelSwarm.m
*** traffic-0.3/ModelSwarm.m    Mon May 22 18:47:56 2000
--- traffic-0.3a/ModelSwarm.m   Tue May 23 10:30:16 2000
***************
*** 186,191 ****
--- 186,204 ----
    return self;
  }
  
+ - (void)forEachCar: (SEL)message
+ {
+   id call =
+     [FCall create: self
+            target: [carList getFirst]
+            selector: message
+            arguments:
+              [[[FArguments createBegin: self]
+                 setSelector: message]
+                createEnd]];
+   
+   [modelActions createFActionForEachHomogeneous: carList call: call];
+ }
  
  - buildActions
  {
***************
*** 194,202 ****
--- 207,221 ----
  
    // Action looks ahead, decides to speed up or slow down
    modelActions = [ActionGroup create: self];
+ #if 1
+   [self forEachCar: M(ChangeLanes)];
+   [self forEachCar: M(AdjustSpeed)];
+   [self forEachCar: M(step)];
+ #else
    [modelActions createActionForEach: carList  message: M(ChangeLanes)];
    [modelActions createActionForEach: carList  message: M(AdjustSpeed)];
    [modelActions createActionForEach: carList  message: M(step)];
+ #endif
  
    // step action passes speed up/slow down command through car's dynamics
    modelActions2 = [ActionGroup create: self];

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]