> On Mar 8, 2017, at 1:38 AM, Sean Luke <[log in to unmask]> wrote:
>
> Generally if it ends with "-ed", it's meant to display information, not to let the user modify it. This is the case for OrientedPortrayal2D: it just shows the orientation. It's a convenience mechanism because drawing object orientation is really, really common and nontrivial compared to, say, changing color.
>
> The primary purpose of Oriented2D (and Scaled2D) is to provide a standard way that agents can indicate their orientation and size, and that such a thing exists, to interested objects. Not sure why an interface like this would violate MVC, quite to the contrary.
Ah, I understand. Right—makes sense. Orientation can be viewed as an intrinsic property of the agent. I’ve been using OrientedPortrayal2D to display information about the internal state of agents (e.g. energy level), rather than their direction of vision or of movement. So for me, Oriented2D is nothing but a means to control a portrayal that displays information other than something direcational, but that goes beyond intended use and is arguably a kludge.
(I find it’s useful to display various sorts of information about agents during runs, so I often use both color and orientation. I had a NetLogo simulation in which there were four variables displayed for each agent using, patch color, agent color, and the color of a second, oriented agent on top of the first one. Fortunately, agents didn’t move around, or I would have had to coordinate moving two NetLogo agents and the patch info for each modeled agent. In Mason, one embeds portrayals inside each other, and they all move together automatically when the underlying agent moves.)
>
> Sean
>
> On Mar 8, 2017, at 4:18 AM, Abrams, Marshall <[log in to unmask]> wrote:
>
>> Not sure if maybe I’m missing something, but thought I’d ask. OrientedPortrayal2D seems unusual in that it has no methods for controlling its intended variation, i.e. its orientation. Instead one makes the agent implement Oriented2D. By contrast if you want the color of a portrayal to reflect the state of the agent, for example, you can override a method in the portrayal class and set the color based on the state of the agent. Then the agent doesn’t have have any features that reflect what’s going on in the UI. Maybe there’s a way to control OrientedPortrayal2D that I’m not seeing, though. Requiring that the agent implement Oriented2D seems like a small violation of the MVC model, but I suppose it’s not that different from defining bean methods and other tricks (e.g. implementing Propertied) that one can use to allow Mason to provide object inspectors with almost no work on the modeler’s part.
>>
>> Thanks-
>>
>> Marshall
>>
>> Marshall Abrams, Associate Professor
>> Department of Philosophy, University of Alabama at Birmingham
>> Email: [log in to unmask]; Phone: (205) 996-7483; Fax: (205) 975-6610
>> Mail: HB 414A, 900 13th Street South, Birmingham, AL 35294-1260; Office: HB 418
>> Website: http://members.logical.net/~marshall
>>
|