MASON-INTEREST-L Archives

July 2012

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Sean Luke <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Sat, 21 Jul 2012 03:41:27 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (28 lines)
On Jul 20, 2012, at 7:58 PM, Eric 'Siggy' Scott wrote:

> It's true, however, that the need for this behavior is quite common -- so eventually it would be nice to have a more unified/integrated solution, IMO.  That may require rolling out own distributions library, though.

By this I presume you mean to add some common repeat-by-distribution options.  We could add those as factory functions, something like this:

public static RandomRepeat makeRepeatByPowerLaw(
	Steppable step, int ordering, boolean shouldSynchronize,
	double exponent,  double lowerCutOff)
	{
	return new RandomRepeat(step, ordering, shouldSynchronize)
		{
		protected double getNextTime(SimState state, double currentTime)
			{
             		 return currentTime + Distributions.nextPowLaw(2.0, 1.0, state.random);
			}
		};
	}

... or something like that.  Then you use it as:

RandomRepeat repeat = RandomRepeat.makeRepeatByPowerLaw(step, initialOrdering, false, 2.0, 1.0);
state.schedule.scheduleOnce(initialTIme, initialOrdering, repeat);

I'd need to know exactly what the common distribution options would be though.

Sean

ATOM RSS1 RSS2