MASON-INTEREST-L Archives

April 2018

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show HTML 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:
Mon, 2 Apr 2018 16:13:48 -0400
Content-Type:
text/plain
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