MASON-INTEREST-L Archives

March 2016

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

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

Print Reply
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Tue, 22 Mar 2016 15:57:10 +0100
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Message-ID:
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
8bit
In-Reply-To:
Content-Type:
text/plain; charset=UTF-8
From:
Luís de Sousa <[log in to unmask]>
Parts/Attachments:
text/plain (40 lines)
Hi there Nick,

I have used agents inheriting from MasonGeometry, something like:

public class Agent extends MasonGeometry implements Steppable, Stoppable

With a constructor taking in a geometry:

public Agent(Geometry geom)
{
    super();
    this.geometry = geom;
    location = geom.getCentroid().getCoordinate();
}

This greatly facilitates programming. However, I never explored
potential performance impacts.

Regards,

Luís

On 22 March 2016 at 14:55, Nick Malleson <[log in to unmask]> wrote:
> Hi all,
>
> This might have an easy answer, apologies if I have missed something on the list.
>
> I am using a GeomVectorField to store my agents. I need to be able to get back to the original Agent object, not just its associated MasonGeometry. I create agents and add them to the GeomVectorField a bit like this:
>
> Agent a = new Agent();
> agentGeomVectorField.addGeometry(a.getGeometry());
> schedule.scheduleRepeating(a);
>
> That basically works fine, but now I want to be able to get back to the underlying agent. I guess I could maintain a separate List of agents as well as the GeomVectorField, or I could add the agent to its MasonGeometry's userData field.
>
> Any opinions on which would be best? How else have people stored their agents and their geometries using geomason?
>
> Thanks in advance,
> Nick

ATOM RSS1 RSS2