MASON-INTEREST-L Archives

April 2018

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show Text 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:
Mon, 2 Apr 2018 16:13:48 -0400
MIME-version:
1.0 (Mac OS X Mail 11.2 \(3445.5.20\))
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Content-type:
text/plain; charset=us-ascii
Subject:
From:
Sean Luke <[log in to unmask]>
In-Reply-To:
Message-ID:
Content-Transfer-Encoding:
8bit
Parts/Attachments:
text/plain (25 lines)
> On Apr 2, 2018, at 4:09 PM, Stewart Aitken <[log in to unmask]> wrote:
> 
> When I make width equal or larger than height it works just as expected.
> But once reversed it gives this out of bounds error and I just wondered if it could be a JAVA bug rather than this code.

ObjectGrid2D is simple.  On initialization it contains:

1. A WIDTH instance variable.
2. A HEIGHT instance variable.
3. A 2D array of Objects which is [WIDTH] by [HEIGHT]

If you do
	new ObjectGrid2D(5, 6)

... you'll get a 2D array which is 5x6.

If you do
	new ObjectGrid2D(6, 5)

... you'll get a 2D array which is 6x5.

There's nothing special about this at all.  This tells me that it almost certainly has to be a bug in your code.  However your code only calls new ObjectGrid(...) once and doesn't seem to do anything special with it.  So it's got to be somewhere *else* in your code.

Sean

ATOM RSS1 RSS2