[Os-project-managers] Equal or equivalent?

Kipp Martin kmartin at chicagobooth.edu
Wed Jan 26 15:48:04 EST 2011


Hi Gus:

Since we are meeting tomorrow we can hash this together, but a few thoughts.

Given

<variables>
      <initVariableValues numberOfVar="0"/>
</variables>

why is it necessary to instantiate an initVariableValues object?  I 
assume you do this because as soon as the parser sees <initVariableValues

it automatically instantiates an object in this class? Is this case?  Is 
there something logically wrong with the member

initVariableValues

being null if numberOfVar="0"?

If we change the schema so that <initVariableValues>  is
only present when numberOfVar is strictly positive or we introducing an 
inconsistency with some part of some other schema?

Cheers


>
> As you know, I have been experimenting with randomly generated object
> instances (currently only OSOption objects), and I have found my first
> serious bug/feature.
>
> Consider the two snippets from an osol file:
>
> ...
> <variables>
>      <initVariableValues numberOfVar="0"/>
> </variables>
> ...
>
> and
>
> ...
> <variables>
> </variables>
> ...
>
> They are clearly different, although they are functionally equivalent. In the
> OSoLWriter I am checking for numberOf...="0" and suppressing the
> generation of the object in that case. (That is, when I read the first version
> and write the corresponding object, what I write is version 2.)
>
> Now, when I then try to test the two objects for equality, they are not equal.
> In the first object, ...variables->initVariableValues points to a real memory
> location, but in the second case it is a NULL pointer.
>
> The question is what I should do about it. Should I simply write the first
> version without compression, should I implement a more complicated test
> for equality, should we change the schema so that<initVariableValues>  is
> only present when numberOfVar is strictly positive, should I do something
> else entirely? (What?)
>
> Any thoughts?
>
> Thanks
>
> gus
>
> _______________________________________________
> Os-project-managers mailing list
> Os-project-managers at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/os-project-managers


-- 
Kipp Martin
Professor of Operations Research
and Computing Technology
Booth School of Business
University of Chicago
5807 South Woodlawn Avenue
Chicago, IL 60637
773-702-7456
kmartin at chicagobooth.edu
http://www.chicagobooth.edu/faculty/bio.aspx?person_id=12825325568
http://projects.coin-or.org/OS



More information about the Os-project-managers mailing list