[Ns-bugs] [Bug 491] It is painful to enable all checksums

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Tue Apr 28 12:30:47 PDT 2009


http://www.nsnam.org/bugzilla/show_bug.cgi?id=491





--- Comment #15 from Craig Dowell <craigdo at ee.washington.edu>  2009-04-28 15:30:46 EDT ---

To summarize, I have a fundamental dislike of global variables.  I think it
would be cleaner to have a system configuration object.

There are now, I think, seven candidates for a system object:

  RngSeed
  RngRun
  SimulatorImplementationType
  SchedulerType
  TimeStepPrecision
  CalcChecksum

That could be used like,

  Config::Set ("/System/RngSeed", IntegerValue (1234));

or

  System ()->SetAttribute ("RngSeed", IntegerValue (1234));

instead of

  Config::SetGlobal ("RngSeed", IntegerValue (1234"));

The difference in the code is that the global variables are not "scattered
around the system" and can be used across multiple files.  I think that
conceptually, this is much better.  One does not have some global variable
defines somewhere deep down in the system.  You don't have to hunt around for
system configuration items, they are in one place.  The danger seems to be that
system configuration items grow to number hundreds or thousands.  I think that
the introduction of Attributes minimizes that risk.  

The end result is that models have their attributes and the system has its
attributes that are gotten to and modified in the same way.  Seems very
consistent and easy to deal with.

Anyway, it seems like an obviously good thing to me. but I'm not going to press
this endlessly.


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Ns-bugs mailing list