Programming standards

The OpenTrafficSim core is written in Java 7.

Directory tree structure

ots-core
    src
        main
            java
                org.opentrafficsim.core.packageName
                    ClassFileName.java
            resources
                localepackageName[_XX].properties
        test
            java
                org.opentrafficsim.core.packageName
                    TestClassFileName.java
            resources
                testResourceFileName
   pom.xml

Java Generics

Java Generics are used to prevent accidental assignments of a speed value to a force, the ID of a ship to a container, etc. If at all possible we want the compiler to stop us from writing such assignments. If that really is impossible or creates very slow code, we like to see a runtime exception as early as possible.

Unit Tests

Unit tests ensure that everything is tested at the lowest feasible level. It would waste a lot of time if, during a traffic simulation run, we find that our conversion from miles to kilometers is wrong. Errors like that should be cought earlier and at a much lower level.

Project Reports

The maven site-deploy operation will run all unit tests and create many reports that help to find errors in the JavaDoc comments, shortcomings in the unit tests, code style, duplicate code, etc.