parameter in config file

Home Forums PeerfactSim Forum parameter in config file

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #774
    tobias amft


    currently I am implementing an own analyzer in PeerfactSim. I know that the analyser class has to be declared in the xml config file of the experiment. e.g.:
    <Analyzer class=”org.peerfact.impl.overlay.dht.chord.chord.analyzer.myAnalyzer” />.

    My question now is:
    how can one hand over parameter to the class?

    param1 = “…”
    param2 = “…”

    Is it possible to reach the variables directly if param1 and param2 are declared public in my analyzer class?
    Or do I have to use getter/setter methods?
    Or do I have to change the Scenario Builder or something like that?

    best regards

    Philipp Giesen

    Hey Tobias,

    yes, setter-methods are the way to go. For each parameter you add in the config file, the engine searches for a setter-method within the class specified. In your example, you would have to add a method setParam1(<typeOfParameter>). param1 and param2 would be declared private in your class but are modified via the setter-methods anyway.

    This works for the host builder and should also work for analyzers. Quite simple. 🙂


    tobias amft

    Thanks for your quick answer,

    you are such an educated person …
    I wish i had your knowledge 😉

    regards Tobi

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Comments are closed.