Code Monkey home page Code Monkey logo

rinde / rinsim Goto Github PK

View Code? Open in Web Editor NEW
110.0 23.0 53.0 23.8 MB

RinSim is a logistics simulator written in Java. RinSim supports (de)centralized algorithms for dynamic pickup-and-delivery problems (PDP). The simulator is developed at the imec-DistriNet group at the dept. of Computer Science, KU Leuven, Belgium.

Home Page: http://rinsim.rinde.nl

License: Apache License 2.0

Java 99.64% Shell 0.15% R 0.22%
java rinsim simulator logistics agents optimization logistics-simulator operational-research

rinsim's Introduction

RinSim 4.4.6

Detailed documentation is available at the documentation website.

RinSim is an extensible logistics simulator with support for (de)centralized algorithms for pickup and delivery problems and AGV routing. The simulator focuses on simplicity and consistency making it ideal for performing scientific simulations. Further, software quality is a priority resulting in an ever improving test suite and documentation.

Javadocs Build Status Maven Central DOI Stackoverflow

Installation

RinSim uses Maven for managing its dependencies. RinSim can be added to your Maven project by including the following in your pom file, where x and y represents the preferred version number.

<dependency>
	<groupId>com.github.rinde</groupId>
	<artifactId>rinsim-core</artifactId>
	<version>4.x.y</version>
</dependency>

Detailed instructions for installation can be found here.

rinsim's People

Contributors

anthonyclays avatar christofluyten avatar entropitor avatar hoangtungdinh avatar maartn avatar rinde avatar robrechth avatar vincentvangestel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rinsim's Issues

Simulator, how to use

I think it would be best if the readme file mentions something about where the users of the simulator should write their own code: NOT in the RinSim project, but in a separately project linked to the RinSim project. Or do you think this is clear already?

On which algorithm is the AGV Routing based

Dear developer,

I would like to use your simulation for my bachelor-thesis in AGV routing. Is there an general definition of your algorithm? What is it based on?

Thanks in advance,
Nassim

Factory example does not work

When trying to run FactoryExample.java the following error appears:

Exception in thread "main" java.lang.IllegalArgumentException: A MovingRoadUser can not be added on an already occupied position (1140.0,90.0).
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:146)
	at com.github.rinde.rinsim.core.model.road.CollisionGraphRoadModelImpl.addObjectAt(CollisionGraphRoadModelImpl.java:152)
	at com.github.rinde.rinsim.core.model.pdp.PDPObjectImpl.initRoadUser(PDPObjectImpl.java:77)
	at com.github.rinde.rinsim.core.model.road.AbstractRoadModel.doRegister(AbstractRoadModel.java:298)
	at com.github.rinde.rinsim.core.model.road.GenericRoadModel.register(GenericRoadModel.java:106)
	at com.github.rinde.rinsim.core.model.road.GenericRoadModel.register(GenericRoadModel.java:34)
	at com.github.rinde.rinsim.core.model.ModelManager.doRegister(ModelManager.java:95)
	at com.github.rinde.rinsim.core.model.ModelManager.register(ModelManager.java:115)
	at com.github.rinde.rinsim.core.Simulator.register(Simulator.java:110)
	at com.github.rinde.rinsim.examples.demo.factory.FactoryExample.run(FactoryExample.java:167)
	at com.github.rinde.rinsim.examples.demo.factory.FactoryExample.main(FactoryExample.java:97)
	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)

The problem is at this line.

If we change it by

    for (int i = 0; i < NUM_VEHICLES; i++) {
      final List<Point> l = points.get(rng.nextInt(points.size()));
      final Point p = l.get(i);
      simulator.register(new AGV(p));
    }

it seems to work, but I don't know if the purpose of this demo is to initialise the AGVs in certain positions. (Don't think so, as they are initialised randomly).

Let me know if I have to create a PR to fix this issue.

BlockingGraphRoadModel misses providing type

When running com.github.rinde.rinsim.examples.demo.factory.FactoryExample the following exception is thrown.

Exception in thread "main" java.lang.IllegalArgumentException: Could not resolve dependency for implementations of interface com.github.rinde.rinsim.core.model.road.GraphRoadModel, as requested by GraphRoadModelRenderer.builder().
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:146)
	at com.github.rinde.rinsim.core.model.DependencyResolver.constructDependencyGraph(DependencyResolver.java:90)
	at com.github.rinde.rinsim.core.model.DependencyResolver.resolve(DependencyResolver.java:115)
	at com.github.rinde.rinsim.core.model.ModelManager$Builder.build(ModelManager.java:268)
	at com.github.rinde.rinsim.core.Simulator.<init>(Simulator.java:88)
	at com.github.rinde.rinsim.core.Simulator$Builder.build(Simulator.java:347)
	at com.github.rinde.rinsim.examples.demo.factory.FactoryExample.run(FactoryExample.java:182)
	at com.github.rinde.rinsim.examples.demo.factory.FactoryExample.main(FactoryExample.java:96)

RinSim version: 4.3.0
A pull request has been created that allows BlockingGraphRoadModel to fullfill the dependency of a GraphRoadModel. #43
This fixes, among others, the FactoryExample.

last check before lab session

  • do a fresh install (fetch the code, create a new project etc)
  • run all unit tests
  • run all examples
  • check available documentation

ExperimentExample is throwing an Exception

I am running com.github.rinde.rinsim.example.experiment in Eclipse Oxygen in a Ubuntu 18
RimSim 4.4.6

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" com.github.rinde.rinsim.experiment.AbortExperimentException: Failed: SimArgs{problemClass=SimpleProblemClass(DEFAULT),instancedId=,masConfig=MASConfiguration,randomSeed=2780242596957121269,repetition=0,postProcessor=com.github.rinde.rinsim.examples.experiment.ExamplePostProcessor@1e9e725a}
	at com.github.rinde.rinsim.experiment.Experiment.perform(Experiment.java:217)
	at com.github.rinde.rinsim.experiment.LocalComputer$ExperimentRunner.call(LocalComputer.java:202)
	at com.github.rinde.rinsim.experiment.LocalComputer$ExperimentRunner.call(LocalComputer.java:193)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:258)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:66)
	at com.github.rinde.rinsim.experiment.LocalComputer.compute(LocalComputer.java:81)
	at com.github.rinde.rinsim.experiment.Experiment$Builder.perform(Experiment.java:684)
	at com.github.rinde.rinsim.experiment.Experiment$Builder.perform(Experiment.java:703)
	at com.github.rinde.rinsim.examples.experiment.ExperimentExample.main(ExperimentExample.java:199)
Caused by: java.lang.NullPointerException
	at org.eclipse.swt.widgets.TabFolder.gtk_switch_page(Unknown Source)
	at org.eclipse.swt.widgets.Widget.windowProc(Unknown Source)
	at org.eclipse.swt.widgets.Display.windowProc(Unknown Source)
	at org.eclipse.swt.internal.gtk.OS._gtk_widget_show(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_widget_show(Unknown Source)
	at org.eclipse.swt.widgets.TabFolder.createItem(Unknown Source)
	at org.eclipse.swt.widgets.TabItem.createWidget(Unknown Source)
	at org.eclipse.swt.widgets.TabItem.<init>(Unknown Source)
	at com.github.rinde.rinsim.ui.SimulationViewer.configurePanels(SimulationViewer.java:254)
	at com.github.rinde.rinsim.ui.SimulationViewer.panelsLayout(SimulationViewer.java:199)
	at com.github.rinde.rinsim.ui.SimulationViewer.show(SimulationViewer.java:181)
	at com.github.rinde.rinsim.ui.SimulationViewer$Builder$1.handleEvent(SimulationViewer.java:743)
	at com.github.rinde.rinsim.ui.View.show(View.java:149)
	at com.github.rinde.rinsim.core.Simulator.start(Simulator.java:186)
	at com.github.rinde.rinsim.experiment.Experiment.perform(Experiment.java:200)
	... 12 more

How to add my own algorithm in RinSim

I want to compare my own algorithm with other paper's algorithm,But I don't know how to add my own algorithm in RinSim.Are there any one can tell me how to do it?Thanks,Looking forward to your reply!

No dots are shown on the map (Ubuntu 11.10 unity)

For example in the solution of the capture the flag in the examples of the lab session 1, I do see a flag but I don't see trucks.

If I change the following line in the code
schema.add(TruckAgent.class, new RGB(255,0,0));
to
schema.add(TruckAgent.class, "/graphics/truck.png");
I do see the images of the trucks.

I have retried it on a completely fresh installation of Ubuntu 11.10 with unity but no solution. It does work on the computer of my friend who is running ubuntu with gnome 3.

I also don't get any errors

If you want more information about my system feel free to ask.

Update ReadMe

The readme is currently not completely clear, there are some redundancies especially in the maven/eclipse installation part.

Define communication model

Communication model should allow the simulator entities to:

  • communicate with other entities within the range (async)
  • broadcast messages within a range
  • find other entities able to communicate within a given range

StatsTracker example - Existing FabriRechtExample fails to run

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.