MASON-INTEREST-L Archives

October 2009

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced 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
Mime-Version:
1.0 (Apple Message framework v936)
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Thu, 29 Oct 2009 21:21:29 +1030
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Subject:
From:
Matthew Berryman <[log in to unmask]>
Content-Transfer-Encoding:
7bit
In-Reply-To:
Content-Type:
text/plain; charset=US-ASCII; format=flowed; delsp=yes
Comments:
To: MASON Multiagent Simulation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (81 lines)
Sean,

I agree it could lead to confusion, but it would be more surprising  
(to me) to have normalize() and rotate(double theta) inconsistent with  
add, etc. within MutableDouble2D. Usually I would pick either one or  
the other, and so internal consistency is slightly more valuable to  
me. Having no side effects would be more functional-like, but this is  
Java.. *shrug* Main thing is to be clear in the docs. Anyone else have  
any thoughts?

Dr Matthew Berryman
Defence and Systems Institute
SPRI Building
University of South Australia
Mawson Lakes  SA  5095
t +61 8 8302 5882
f +61 8 8302 5344
m +61 413 458 594
CRICOS Provider Number: 00121B



On 29/10/2009, at 8:42 PM, Sean Luke wrote:

> So the problem with (B) is this.  Let's say that M (and M0) is a
> MutableDouble2D and D (and D0) is a Double2D.
>
> If I say:
>
> Double2D Q = D.add(M)
> or
> Double2D Q = D.add(D0)
>
> This will put into Q the result of D+M (or D+D0), but neither D, nor
> D0, nor M will be modified.
>
> However if I say
>
> MutableDouble2D Q = M.add(D)
> or
> MutableDouble2D Q = M.add(M0)
>
> This will put into Q the result of D+M (or M0+M), but also set M to
> that result.
>
> I would imagine this would be... fairly surprising.  Wouldn't you?
> That's what concerns me.
>
> Sean
>
>
> On Oct 29, 2009, at 10:49 AM, Matthew Berryman wrote:
>
>> Sean,
>>
>> I agree with your points on (B), and this would be personally least
>> surprising to me, given the other existing methods (it is mutable,
>> after all :)
>> I'm just a sample size of one, though.
>>
>> Cheers,
>> Dr Matthew Berryman
>> Defence and Systems Institute
>> SPRI Building
>> University of South Australia
>> Mawson Lakes  SA  5095
>> t +61 8 8302 5882
>> f +61 8 8302 5344
>> m +61 413 458 594
>> CRICOS Provider Number: 00121B
>>
>>
>>
>> On 29/10/2009, at 7:40 PM, Sean Luke wrote:
>>
>>> Not hearing a peep from the peanut gallery :-( I'm inclined to make
>>> the (B) modifications.  Going once, going twice?
>>>
>>> Sean
>>>

ATOM RSS1 RSS2