[Ns-developers] Default Values

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Sat Jan 19 09:32:39 PST 2008


On Sat, 2008-01-19 at 09:33 -0500, Joseph Kopena wrote:
> On Jan 19, 2008 4:09 AM, Mathieu Lacage <mathieu.lacage at sophia.inria.fr> wrote:
> > On Fri, 2008-01-18 at 21:27 -0500, Joseph Kopena wrote:
> > What sounds chaotic ? Craig's generic Set ("path", value) proposal was
> > not related in any way to DefaultValues: it was related to an extension
> > of the Parameter proposal.
> 
> But aren't the Set & Parameter discussions basically talking about
> replacing the default values system?  It sounds unfortunate to

I do not think that the proposal is to remove the functionality provided
by the DefaultValue system. I suspect we can actually keep the name but
change the implementation.

> maintain all of them---I would assume one (the simplest) will come to
> be predominantly used for the functionality the others were intending
> to provide, and there'll just be a real mix-match of each being used
> in random places.  My understanding was that they were proposing
> schemes for parameterizing simulations that added naming and scope
> structure, which the default value scheme does not currently have.

ok.

> 
> In any event, having objects continually reference the
> parameterization scheme throughout their lifetime & be subject to
> changes therein sounds chaotic.

I don't really understand what the above paragraph means so, I can't
comment: could you describe more precisely what you mean by "having
objects continually reference the parameterization scheme throughout
their lifetime"  ?

> 
> > Sure. However, it seems pretty obvious to me that calling a Setter on a
> > factory is not to going to influence in any way the behavior of an
> > object which has already been created by that factory. Or are you
> > referring to another problem ?
> 
> Right, and I think that could be made fairly obvious for default
> values as well if the style were adopted that they are not referenced
> after object creation.  However, the factory get/set scheme seemed to
> be being put forward to address the concern of objects created during
> simulation runtime and not being subject to default value changes made
> after the simulation was initialized.  I'm saying it doesn't do that
> anymore than the other schemes.

The Parameter stuff is, however, exactly solving that problem: it is
making sure that an object cannot reference the global value set by a
user outside of the object member variable initialization process. Now,
of course, objects could be created/initialized _during_ simulation but
this is not a problem I am concerned about.

> > > What if default values could be locked, either system wide or by
> > > specific variables?  If anything tries to change one afterward, the
> > > sim bails and the user knows something's going on.
> >
> > I am not sure I understand what you are proposing here.
> 
> So, for example, you could write the following code:
> 
> main() {
>   set default values
>   process command line for default value overrides
>   lock default values
>   create simulation, loading modules, protocols, etc
>   run simulation
>   tear down
> }
> 
> In this case, by locking the default values, you prevent non-user code
> (i.e. some arbitrary protocol or mobility model I've loaded) from
> changing the default values away from what I as the simulation coder
> intended them to be.  I thought that was a problem being put forward
> for the simulation parameterization schemes to address.

ok.

Mathieu


More information about the Ns-developers mailing list