MASON-INTEREST-L Archives

May 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:
Sun, 27 May 2012 16:03:09 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (18 lines)
Hi Axel.  Yes, this sort of thing should be done in the start() method.  So why are they sometimes also set up in init()?  Because even if the model isn't running, you're still "visualizing" it by having a window open which displays the (pre-running) model.  So you have to initialize it to _something_ when the window is first created.

Sean

On May 27, 2012, at 2:06 AM, Axel Kowald wrote:

> Okay, I found a solution.
> Instead of creating the Display2D in the init() method, I moved it to the
> start() method and used this.controller.registerFrame() to register the
> frame with the controller. 
> Now everything works, because I create the Display2D now after I have set
> the new grid dimensions in the controller window. It seems that I could move
> in principle everything from the init() method into the start() method. But
> why do I need then a separate init() ?  
> Any comments ? 
> 
> Axel

ATOM RSS1 RSS2