[ProgSoc] Predict Sydney traffic?

sanguinev at progsoc.org sanguinev at progsoc.org
Thu Dec 16 10:08:06 EST 2010

Hash: SHA1

On 15/12/2010 11:32 PM, John Elliot wrote:

> Cool. It's amazing how CPU intensive it is. I completely re-wrote the
> genetic algorithm platform to use performant data structures (arrays
> instead of linked lists, and sealed classes rather than interfaces) and
> still it takes ages. I've been running it for a few days and have only
> done 38 generations (of ~150 strategies per generation).

Do you have a version that can run on linux with a typical C/C++/etc.

> Good luck with the python port, I'll be interested to check it out.
> For now there is one particular problem I have that has me stumped,
> which is really annoying because I'm sure it's a trivial problem really.
> What I'm trying to do is build a model where if there is data within say
> the last n minutes (where n might be 60 or 120, or whatever) then the
> most recent reading will factor significantly in the results, whereas if
> the most recent reading is too far away (i.e. more than n minutes away)
> then it won't factor so significantly as a result. So if you're trying
> to predict 15 minutes into the future then the present reading is highly
> relevant, whereas if you're trying to predict 24 hours into the future
> then the current reading isn't likely so relevant as say a weekly
> average. Now the simple way to do this would be to do something like,
>   if ( n > 120 minutes ) {
>     last_reading_weight = 10000;
>   }
>   else {
>     last_reading_weight = 0;
>   }
> But what I'd like instead (or "as well" I should say, because it's no
> trouble to trial each model) is a function (or maybe several functions
> could be trialed) that takes n and turns it into a weight in a more
> continuous fashion, where maybe I'd get readings like,
>   f( 0 ) = 10000
>   f( 15 ) = 9000
>   ...
>   f( 60 ) = 1000
>   f( 120 ) = 500
>   ...
>   f( 1440 ) = 0.001
> It would be ideal if the function f also took a random floating point
> value that modified the distribution while keeping the lower and upper
> bounds relatively in tact. Can anyone think of such a function?

Something like:

float f(float mins)
  if (mins < 1)
  then {return 10000;}
  else {return ((10000/mins)*random());}

Where random() is a float in the range 0 to 1.

Obviously some other adjustments need to be made to balance the
weightings to match your desired results or reduce the influence of the
random value. But the basic shape seems to be what you want.

- - SanguineV
Version: GnuPG v1.4.10 (MingW32)


More information about the Progsoc mailing list