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?
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?
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. 🙂