Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StatsTracker example - Existing FabriRechtExample fails to run #40

Open
hannesdm opened this issue Mar 30, 2017 · 1 comment
Open

StatsTracker example - Existing FabriRechtExample fails to run #40

hannesdm opened this issue Mar 30, 2017 · 1 comment

Comments

@hannesdm
Copy link

hannesdm commented Mar 30, 2017

RinSim version: 4.3.0
I would like to request an additional example/tutorial on how to retrieve statistics after running a RinSim experiment or simulation.
The only example using StatsTracker seems to be FabriRechtExample, which at the moment of writing fails to run.
A few remarks on the FabriRechtExample:

  • The main method is called 'main2'
  • The line
    new File("../scenario-util/files/test/fabri-recht/lc101.scenario"),
    throws a FileNotFoundException.
    Likely this is an issue with me using IntelliJ instead of Eclipse, which can use a different execution root when running a file from inside the IDE. Changing the file path to "scenario-util/files/test/fabri-recht/lc101.scenario" fixes this problem.
  • When running the example after fixing the issues above above another exception is thrown:
Exception in thread "main" java.lang.IllegalArgumentException: A provider for interface com.github.rinde.rinsim.pdptw.common.StatisticsProvider already exists: Dependency-StatsTracker.builder().
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:146)
	at com.github.rinde.rinsim.core.model.DependencyResolver.add(DependencyResolver.java:75)
	at com.github.rinde.rinsim.core.model.ModelManager$Builder.doAdd(ModelManager.java:231)
	at com.github.rinde.rinsim.core.model.ModelManager$Builder.add(ModelManager.java:212)
	at com.github.rinde.rinsim.core.Simulator$Builder.addModel(Simulator.java:324)
	at com.github.rinde.rinsim.examples.fabrirecht.simple.FabriRechtExample.main(FabriRechtExample.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

I do not know how to resolve this last issue.
Would it be possible to write a tutorial on how to use the StatsTracker or is there another way to retrieve and calculate statistics, evaluation results, etc. in RinSim?
The reason for this is that it would be extremely useful to get access to statistics after an experiment (using the RinSim experiment API) or other simulation has been completed. Statistics such as throughput, latency, package distribution, etc. would be very helpful in the evaluation of multi agent systems.

@rinde
Copy link
Owner

rinde commented Mar 30, 2017

The reason that this example is disabled is because it is broken and I have currently no plans to fix it. Adding an example/tutorial about gather statistics in general and StatsTracker in particular is a good idea. I'll take a look at it in the following weeks, I'll update this thread when I've made progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants