MCPcopy Index your code
hub / github.com/egueli/TraCI4J

github.com/egueli/TraCI4J @TraCI4J-2.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release TraCI4J-2.5 ↗ · + Follow
672 symbols 2,110 edges 88 files 358 documented · 53% updated 8y ago★ 445 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

What is TraCI4J

TraCI4J is a Java library for interfacing SUMO with a Java program to control and/or watch a traffic simulation via SUMO's TraCI interface.

It was initially developed by members at ApPeAL (Applied Pervasive Architectures Lab) in Politecnico di Torino.

What can TraCI4J do

The library can act as a complete front-end for a SUMO instance. The simulation can be started, stopped and advanced step by step.

The SUMO instance can be run by the library itself or can be already running. Since the TraCI communication is done via TCP, the existing SUMO instance can be in the same machine or in another host.

While the simulation is running, many informations can be retrieved, both static (e.g. the road network topology) and dynamic (e.g. position and speed of vehicles). A set of TraCI4J classes match the corresponding TraCI objects, each with methods that allow for value reading and state changing.

Development status

The library is currently in alpha development stage. Some of the TraCI features are available as TraCI4J classes and work as expected (although more testing is needed), while some others still need to be written.

How to get it

You can download TraCI4J right here with the tools provided via GitHub.

There are no binaries: the library is available as source code in an Eclipse project. Import it in your workspace and Eclipse will try to automatically build it.

The library can also be built outside Eclipse via Ant. The default target in the build.xml file will try to compile all code to .class files.

How to get feedback

You can use the mailing list to ask for information to the authors and/or other users.

Bug reports and feature requests can be posted in the Issues tab.

How to use it

First of all, you need:

  • A working SUMO installation (0.23.0 or higher)
  • Be familiar with SUMO, i.e. know its basic principles, how to set up the input files, how to run it...
  • A SUMO file set (a config file, a net description file and a routes file at least)
  • A Java SE 1.7 virtual machine

You can find some usage examples in this directory.

Disclaimer

TraCI4J is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

TraCI4J is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Extension points exported contracts — how you extend this code

WriteableToStorage (Interface)
Classes that implement this interface can be serialized to a Storage. @author Enrico Gueli <enrico.gueli@pol [8 implementers]
src/java/it/polito/appeal/traci/protocol/WriteableToStorage.java
StepAdvanceListener (Interface)
Interface for an object that can be notified when the simulation advances by one step. @author Enrico Gueli <enrico. [5 …
src/java/it/polito/appeal/traci/StepAdvanceListener.java
VehicleLifecycleObserver (Interface)
Interface for a class that wants to be notified about the life-cycle of a vehicle. @author Enrico Gueli <enrico.guel [1 …
src/java/it/polito/appeal/traci/VehicleLifecycleObserver.java

Core symbols most depended-on inside this repo

add
called by 69
src/java/it/polito/appeal/traci/MultiQuery.java
getByID
called by 64
src/java/it/polito/appeal/traci/Repository.java
writeByte
called by 57
src/java/de/uniluebeck/itm/tcpip/Storage.java
nextSimStep
called by 42
src/java/it/polito/appeal/traci/SumoTraciConnection.java
get
called by 42
src/java/it/polito/appeal/traci/ValueReadQuery.java
content
called by 37
src/java/it/polito/appeal/traci/protocol/Command.java
getID
called by 35
src/java/it/polito/appeal/traci/TraciObject.java
checkType
called by 31
src/java/it/polito/appeal/traci/Utils.java

Shape

Method 552
Class 113
Interface 4
Enum 3

Languages

Java100%

Modules by API surface

test/java/it/polito/appeal/traci/test/TraCITest.java62 symbols
src/java/it/polito/appeal/traci/SumoTraciConnection.java44 symbols
src/java/it/polito/appeal/traci/Repository.java41 symbols
src/java/it/polito/appeal/traci/ReadObjectVarQuery.java34 symbols
src/java/it/polito/appeal/traci/protocol/BoundingBox.java33 symbols
src/java/de/uniluebeck/itm/tcpip/Storage.java33 symbols
src/java/it/polito/appeal/traci/protocol/StringList.java24 symbols
test/java/it/polito/appeal/traci/test/NanoHTTPD.java17 symbols
src/java/it/polito/appeal/traci/ChangeObjectVarQuery.java15 symbols
test/java/it/polito/appeal/traci/test/TrafficLightsTest.java13 symbols
src/java/de/uniluebeck/itm/tcpip/Socket.java13 symbols
test/java/it/polito/appeal/traci/test/TraCIServerTest.java11 symbols

For agents

$ claude mcp add TraCI4J \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page