MASON-INTEREST-L Archives

March 2016

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional 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:
Tue, 22 Mar 2016 14:12:34 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (28 lines)
On Mar 21, 2016, at 4:08 AM, Christian Meyer <[log in to unmask]> wrote:

> OK, an optional interface with one method getSortComparator() that can 
> be implemented by the inspected object could be a practicable solution. 
> Adds another interface though.

I've got to think further about pretty ways of doing sorting of properties, but for now I've tweaked the code pretty heavily so that you can just implement the Propertied interface (for now), along these lines:

public Properties properties() 
	{ return new sim.util.SimpleProperties(this, false).
		sortAlphabetically(); }

Or more generally....

public Properties properties() 
	{ return new sim.util.SimpleProperties(this, false).
		sort(new String[]
			{
			"MinimumIdealTemperature",
			"EvaporationConstant",
			"MaximumIdealTemperature",
			"DiffusionConstant"
			}); }

I added some documentation to this effect in the manual too.

Sean

ATOM RSS1 RSS2