[Ns-developers] [ns3] topology API
mathieu.lacage at sophia.inria.fr
Tue Jan 15 11:03:20 PST 2008
On Tue, 2008-01-15 at 17:14 +0000, Gustavo Carneiro wrote:
> > This example seems a bit inconsistent. On one hand you have
> > container.Add (mobility.GetByBoundingBox (...)), on the
> other hand
> > application.AddOnOff(container, ...), two different
> styles... which
> > one is it?
> I am not really sure I understand this comment: I fail to see
> what is
> different between these two styles:
> - GetByBoundingBox returns a NodeContainer and we invoke
> NodeContainer::Add (const NodeContainer & c) to add it to the
> OK, I completely missed the point of "mobility.GetByBoundingBox" :|
> Something doesn't add up. Why 'mobility.GetByBoundingBox()'?
> Shouldn't it be a function or static method, rather than an instance
> method? And what does it have to do with "mobility"? So, yes, I
> agree with the idea, but the naming is not so good and got me
> confused. Yes, I get easily confused, I know :P
> It should have been a GetNodesInsideBoundingBox function, not method.
> And IMHO this sort of API is not needed in NS-3 and can even be
> distracting. But, well, apparently I'm the only one who thinks that
> way, so...
I don't have a definite answer here: I understand your concerns and I
partly agree with them. I don't like very much either solution myself.
> Sure. The goal, here, however, is to provide syntactical
> conveniance. If
> you want "simplicity", you can use the low-level API.
> Fine, but we need to be careful to make sure that NS-3 does not become
> like some systems where there is a nice and easy frontend that does
> common things, but when you want something less common you have to go
> to a lower layer where everything is incredibly complex and
> unforgiving to small errors. In some ways NS-2 is like that: you
> start softly with oTCL, but to do real research you have to go to the
> C++ level and start hacking it. If we start relying too much on high
> level interfaces I am afraid we might unconsciously start neglecting
> the intermediate layers because the front end hides the "uglyness"
> I am not saying this is the case _now_, just something that may
> happen in the future, to be aware of.
Yes, I agree. We need to be careful.
> > Finally I prefer the naming NodeGroup rather than
> > because container sounds like simulating a physical entity
> > actually contains nodes, while group is obviously a purely
> > entity.
> I don't really agree but I don't feel very strongly about it.
> I don't feel very strongly about it either.
Another option is NodeSet.
More information about the Ns-developers