Commit 899d618f authored by Jean Meurice's avatar Jean Meurice Committed by Evgeny Kusmenko

Repackaging + JavaFX replacements

parent 78fb0bfb
......@@ -27,7 +27,6 @@ masterJobLinux:
stage: linux
image: maven:3-jdk-8
script:
- apt-get update && apt-get install -y --no-install-recommends openjfx && rm -rf /var/lib/apt/lists/*
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean deploy --settings settings.xml
only:
- master
......@@ -38,12 +37,13 @@ masterJobWindows:
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings settings.xml
tags:
- Windows10
only:
- master
BranchJobLinux:
stage: linux
image: maven:3-jdk-8
script:
- apt-get update && apt-get install -y --no-install-recommends openjfx && rm -rf /var/lib/apt/lists/*
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings settings.xml
except:
- master
......@@ -5,7 +5,10 @@ This repository includes the interfaces and general functionality for the other
It should be noted that this repository should not have any dependencies on the other repositories - instead all other repositories are allowed to have this repository as dependency.
# Data exchange: Vehicle Controller
Constant values in the `BusEntry.java` class file are required for the exchange of data between the simulation and the controller.
## JavaFX replacement
For example, new available sensors need to be included here.
[Point2D](src/main/java/de/rwth/monticore/EmbeddedMontiArc/simulators/commons/utils/Point2D.java), [Point3D](src/main/java/de/rwth/monticore/EmbeddedMontiArc/simulators/commons/utils/Point3D.java) and [Pair](src/main/java/de/rwth/monticore/EmbeddedMontiArc/simulators/commons/utils/Pair.java) replace the classes of the same name from the JavaFX library.
## LibraryService
The [LibraryService](src/main/java/de/rwth/monticore/EmbeddedMontiArc/simulators/commons/utils/LibraryService.java) allows to export native libraries from the resources of a jar at runtime.
......@@ -27,7 +27,7 @@
<groupId>montisim</groupId>
<artifactId>commons</artifactId>
<version>1.0.8</version>
<version>1.0.9</version>
<properties>
......
......@@ -55,31 +55,5 @@
<url>https://nexus.se.rwth-aachen.de/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>se-nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled /></releases>
<snapshots><enabled /></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled /></releases>
<snapshots><enabled /></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>se-nexus</activeProfile>
</activeProfiles>
</settings>
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.composite;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.composite;
public class BusArray implements BusComponent {
private BusComponent contents[];
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.composite;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.composite;
/**
A BusComponent structure represents a tree-like data-set using the Composite Pattern.
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.composite;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.composite;
import java.util.HashMap;
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.composite;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.composite;
/**
BusValue objects should only content basic data types (double, int, ...).
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.controller.commons;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.controller.commons;
/**
* This enum is used to administrate the entries of the Bus.
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.controller.commons;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.controller.commons;
/**
* This enum is used to administrate the entries of the NavgationBlock.
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.controller.commons;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.controller.commons;
/**
* This enum administrates all surfaces
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.controller.commons;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.controller.commons;
import org.apache.commons.math3.linear.RealVector;
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.controller.interfaces;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.controller.interfaces;
import java.util.Map;
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.controller.interfaces;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.controller.interfaces;
import java.util.Map;
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.map;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.map;
/**
* Created by lukas on 31.01.17.
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.map;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.map;
import java.util.ArrayList;
......
......@@ -18,9 +18,9 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.map;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.map;
import commons.utils.Point3D;
import de.rwth.monticore.EmbeddedMontiArc.simulators.commons.utils.Point3D;
import java.util.HashMap;
/**
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.map;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.map;
/**
* Created by lukas on 31.01.17.
......
......@@ -18,9 +18,9 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.map;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.map;
import commons.utils.Point3D;
import de.rwth.monticore.EmbeddedMontiArc.simulators.commons.utils.Point3D;
/**
* Created by lukas on 31.01.17.
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.map;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.map;
import java.util.List;
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.simulation;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation;
/**
* Interface for a discrete event in a discrete event simulation
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.simulation;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation;
/**
* Interface for objects that want to get notified by a discrete event simulation about specified actions
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.simulation;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation;
import java.util.Collections;
import java.util.LinkedList;
......@@ -29,7 +29,7 @@ import java.util.Optional;
* Abstract class for a discrete event simulation based on scheduled events
* This class implements the SimulationLoopNotifiable interface to be combined with vehicle simulator
*/
public abstract class DiscreteEventSimulator < DiscreteEventType extends DiscreteEvent > implements SimulationLoopNotifiable {
public abstract class DiscreteEventSimulator < DiscreteEventType extends DiscreteEvent > extends SimulationLoopNotifiable {
/** Current total time in the discrete event simulation measured in nanoseconds */
private long simulationTimeNs = 0;
......@@ -257,65 +257,36 @@ public abstract class DiscreteEventSimulator < DiscreteEventType extends Discret
public void didExecuteLoop(List<SimulationLoopExecutable> simulationObjects, long totalTime, long deltaTime) {
advanceSimulationTime(deltaTime * 1000000L);
}
/**
* Is called just before the simulation objects update their states.
* Improved toString() method to get more information
*
* @param simulationObjects List of all simulation objects
* @param totalTime Total simulation time in milliseconds
* @param deltaTime Delta simulation time in milliseconds
* @return String of information about object
*/
@Override
public String toString() {
return "DiscreteEventSimulator{" +
"simulationTimeNs=" + simulationTimeNs +
", eventList=" + eventList +
", discreteEventSimulationNotifiableList=" + discreteEventSimulationNotifiableList +
'}';
}
/*
Allow overriding of these methods from SimulationLoopNotifiable by sub-classes.
*/
@Override
public void willExecuteLoop(List<SimulationLoopExecutable> simulationObjects, long totalTime, long deltaTime) {}
/**
* Is called for each object just before the simulation objects update their states.
*
* @param simulationObject Object for which the loop will be executed
* @param totalTime Total simulation time in milliseconds
* @param deltaTime Delta simulation time in milliseconds
*/
@Override
public void willExecuteLoopForObject(SimulationLoopExecutable simulationObject, long totalTime, long deltaTime) {}
/**
* Is called for each object after the simulation objects updated their states.
*
* @param simulationObject Object for which the loop iteration has been completed
* @param totalTime Total simulation time in milliseconds
* @param deltaTime Delta simulation time in milliseconds
*/
@Override
public void didExecuteLoopForObject(SimulationLoopExecutable simulationObject, long totalTime, long deltaTime) {}
/**
* Is called just before the simulation starts
*
* @param simulationObjects List of all simulation objects
*/
@Override
public void simulationStarted(List<SimulationLoopExecutable> simulationObjects) {}
/**
* Is called just after the simulation ends
*
* @param simulationObjects List of all simulation objects
* @param totalTime Total simulation time in milliseconds
*/
@Override
public void simulationStopped(List<SimulationLoopExecutable> simulationObjects, long totalTime) {}
/**
* Improved toString() method to get more information
*
* @return String of information about object
*/
@Override
public String toString() {
return "DiscreteEventSimulator{" +
"simulationTimeNs=" + simulationTimeNs +
", eventList=" + eventList +
", discreteEventSimulationNotifiableList=" + discreteEventSimulationNotifiableList +
'}';
}
}
\ No newline at end of file
/**
*
* ******************************************************************************
* MontiCAR Modeling Family, www.se-rwth.de
* Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
* All rights reserved.
*
* This project is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.simulation;
import org.apache.commons.math3.linear.RealVector;
/**
* Interface that represents a physical vehicle in 3D space.
* Any positions and vectors are, if not stated otherwise, expressed in the global coordinate system.
* All values are expressed in SI units.
*/
public interface IPhysicalVehicle extends PhysicalObject {
/**
* Function that returns the wheel radius of the physical vehicle
* @return Wheel radius of the physical vehicle
*/
double getWheelRadius();
/**
* Function that returns the steering angle of the physical vehicle
* @return Steering angle of the physical vehicle
*/
double getSteeringAngle();
/**
* Function that returns a copy of the position vector of the center of the front right wheel
* @return Position vector of the center of the front right wheel
*/
RealVector getFrontRightWheelGeometryPosition();
/**
* Function that returns a copy of the position vector of the center of the front left wheel
* @return Position vector of the center of the front left wheel
*/
RealVector getFrontLeftWheelGeometryPosition();
/**
* Function that returns a copy of the position vector of the center of the back right wheel
* @return Position vector of the center of the back right wheel
*/
RealVector getBackRightWheelGeometryPosition();
/**
* Function that returns a copy of the position vector of the center of the back left wheel
* @return Position vector of the center of the back left wheel
*/
RealVector getBackLeftWheelGeometryPosition();
}
/**
*
* ******************************************************************************
* MontiCAR Modeling Family, www.se-rwth.de
* Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
* All rights reserved.
*
* This project is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation;
import org.apache.commons.math3.linear.RealVector;
/**
* Interface that represents a physical vehicle in 3D space.
* Any positions and vectors are, if not stated otherwise, expressed in the global coordinate system.
* All values are expressed in SI units.
*/
public interface IPhysicalVehicle extends PhysicalObject {
/**
* Function that returns the wheel radius of the physical vehicle
* @return Wheel radius of the physical vehicle
*/
double getWheelRadius();
/**
* Function that returns the steering angle of the physical vehicle
* @return Steering angle of the physical vehicle
*/
double getSteeringAngle();
/**
* Function that returns a copy of the position vector of the center of the front right wheel
* @return Position vector of the center of the front right wheel
*/
RealVector getFrontRightWheelGeometryPosition();
/**
* Function that returns a copy of the position vector of the center of the front left wheel
* @return Position vector of the center of the front left wheel
*/
RealVector getFrontLeftWheelGeometryPosition();
/**
* Function that returns a copy of the position vector of the center of the back right wheel
* @return Position vector of the center of the back right wheel
*/
RealVector getBackRightWheelGeometryPosition();
/**
* Function that returns a copy of the position vector of the center of the back left wheel
* @return Position vector of the center of the back left wheel
*/
RealVector getBackLeftWheelGeometryPosition();
}
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.simulation;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation;
import java.util.concurrent.atomic.AtomicLong;
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.simulation;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation;
import org.apache.commons.math3.linear.RealMatrix;
import org.apache.commons.math3.linear.RealVector;
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.simulation;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation;
/**
* Enum for the types of physical objects
......
......@@ -18,9 +18,9 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.simulation;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation;
import commons.controller.commons.BusEntry;
import de.rwth.monticore.EmbeddedMontiArc.simulators.commons.controller.commons.BusEntry;
/**
* Created by Aklima Zaman on 16-Dec-16. This is an interface for a sensor. It
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.simulation;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation;
/**
* Should be implemented by all objects represented in the simulation that should
......
......@@ -18,7 +18,7 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package commons.simulation;
package de.rwth.monticore.EmbeddedMontiArc.simulators.commons.simulation;
import java.util.List;
......@@ -26,8 +26,9 @@ import java.util.List;
* Informs objects about state changes in the simulation. To be informed about
* the simulation loop, you first need to register the object to the shared
* instance of the simulator using registerLoopObserver().
* Override the required functions to get notified for a given simulation event.
*/
public interface SimulationLoopNotifiable {
public abstract class SimulationLoopNotifiable {
/**
* Is called just before the simulation objects update their states.
*
......@@ -35,7 +36,7 @@ public interface SimulationLoopNotifiable {
* @param totalTime Total simulation time in milliseconds