Mailing list archive (omnetpp-l at omnetpp.org)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: [Omnetpp-l] [omnetpp] Module parameters problem
> have you tried getting the parameters in a later initialization stage
> and not in stage 0?
This won't help: parameters are added and assigned before the first
initialization stage.
Andras
> -----Original Message-----
> From: omnetpp-l-bounces at xxx [mailto:omnetpp-l-bounces at xxx]
> On Behalf Of Christoph Mayer
> Sent: Sunday, July 20, 2008 5:36 PM
> To: OMNeT++ Discussion List
> Subject: Re: [Omnetpp-l] [omnetpp] Module parameters problem
>
> Hi,
>
>
> Chris
>
> Solo Zhang schrieb:
> > Hi, everyone, I have defined my own application layer module, which has
> three extra parameters: lowerbound, upperbound and hostile. Here is the
> code:
> >
> > simple NewApplLayer
> > parameters:
> > debug: bool,
> > headerLength: numeric const,
> > lowerbound: numeric const,
> > upperbound: numeric const,
> > hostile: bool;
> > gates:
> > in: lowergateIn;
> > out: lowergateOut;
> > in: lowerControlIn;
> > endsimple
> >
> > and part of my NewApplLayer.cc code for this module:
> >
> > #include <omnetpp.h>
> > #include ......
> >
> > Define_Module_Like(NewApplLayer, BasicApplLayer);
> >
> > void NewApplLayer::initialize(int stage)
> > {
> > BasicApplLayer::initialize(stage);
> > if(stage == 0)
> > {
> > count = 0;
> >
> > headerLength = par("headerLength");
> >
> > lowerbound = par("lowerbound");
> >
> > upperbound = par("upperbound");
> > ......
> > }
> >
> > and I also define these parameters in the NewApplLayer.h file:
> >
> > #include <omnetpp.h>
> > #include ......
> >
> > class NewApplLayer : public BasicApplLayer
> > {
> > protected:
> > int count;
> >
> > int headerLength;
> > int lowerbound;
> > int upperbound;
> > ......
> > }
> >
> > however, when I try to load the simulator, it gives me this error: Error
> in module (NewApplLayer) manetsSim.host[0].appl: has no parameter called
> "lowerbound".
> >
> > I really cannot see the problem, it doesnt make sense to me at all.
> Please help, Thank you!!!
> >
> >
> >
> > __________________________________________________________
> > Not happy with your email address?.
> > Get the one you really want - millions of new email addresses available
> now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
> > _______________________________________________
> > OMNeT++ Mailing List
> > options: http://lists.omnetpp.org/mailman/listinfo/omnetpp-l
> > archive: http://www.omnetpp.org/listarchive/index.php
>
> --
> Dipl.-Inform. Christoph P. Mayer
> Institute of Telematics, University of Karlsruhe (TH)
> Zirkel 2, 76128 Karlsruhe, Germany
> Phone: +49 721 608 6415, Email: mayer at xxx
> Web: http://www.tm.uka.de/~mayer/
> _______________________________________________
> Omnetpp-l mailing list
> Omnetpp-l at xxx
> http://lists.omnetpp.org/mailman/listinfo/omnetpp-l
_______________________________________________
Omnetpp-l mailing list
Omnetpp-l at xxx
http://lists.omnetpp.org/mailman/listinfo/omnetpp-l
Home |
Main Index |
Thread Index