Commit eff5d429 authored by Julian Zobel's avatar Julian Zobel 🦄
Browse files

Merge branch 'master' into 'cherry-pick-7698d9d7'

# Conflicts:
#   src/de/tud/kom/p2psim/impl/analyzer/metric/output/MetricOutputDAO.java
#   src/de/tud/kom/p2psim/impl/util/db/dao/DAO.java
parents 1c7f20ec 37020b44
......@@ -28,6 +28,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
......@@ -69,6 +70,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
......@@ -98,6 +100,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,NORMAL,LOW
......
......@@ -12,7 +12,7 @@
<distributionManagement>
<repository>
<id>kom-deploy</id>
<url>scp://dev.kom.e-technik.tu-darmstadt.de/srv/www/dev/htdocs/mvn</url>
<url>scp://dev.kom.e-technik.tu-darmstadt.de/mvn</url>
</repository>
</distributionManagement>
......@@ -29,42 +29,12 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</execution>
</executions>
</plugin>
</plugin>
</plugins>
<extensions>
<!-- Enabling the use of SSH -->
......@@ -78,7 +48,7 @@
<repositories>
<!-- simonstrator-repository -->
<!-- simonstrator-repository -->
<repository>
<id>simonstrator</id>
<url>https://dev.kom.e-technik.tu-darmstadt.de/mvn/</url>
......@@ -89,42 +59,44 @@
<updatePolicy>always</updatePolicy>
</releases>
</repository>
<!-- local kom repository -->
<!-- <repository>
<id>maven.kom</id>
<url>http://www.kom.tu-darmstadt.de/~stingl/PeerfactSim.KOM-Libraries/maven2/</url>
</repository> -->
<!-- jgrapht can be found there -->
<repository>
<id>conjars.org</id>
<url>http://conjars.org/repo</url>
</repository>
<!-- uk maven central, since the local central server is slow as hell -->
<repository>
<id>uk.maven.org</id>
<url>http://uk.maven.org/maven2</url>
<id>Google Maven Central</id>
<url>https://maven-central.storage.googleapis.com/repos/central/data/</url>
<snapshots>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
<dependencies>
<!-- XML -->
<!-- https://mvnrepository.com/artifact/javax.xml/jsr173 -->
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jsr173</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>txw2</artifactId>
<version>3.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/stax/stax -->
<dependency>
<groupId>stax</groupId>
<artifactId>utils</artifactId>
<version>1.0.0</version>
<groupId>stax</groupId>
<artifactId>stax</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
......@@ -137,15 +109,13 @@
<artifactId>batik-1.5-fop</artifactId>
<version>0.20-5</version>
</dependency>
<!-- unused? <dependency> <groupId>batik</groupId> <artifactId>batik-parser</artifactId>
<version>1.5</version> </dependency> <dependency> <groupId>batik</groupId>
<artifactId>batik-awt-util</artifactId> <version>1.5</version> </dependency> -->
<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.0</version>
<version>4.13</version>
</dependency>
<dependency>
<groupId>junit-addons</groupId>
......@@ -153,15 +123,22 @@
<version>1.4</version>
</dependency>
<!-- Logging -->
<!-- unused <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version> </dependency> <dependency> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <version>1.6.1</version> </dependency> -->
<!-- Logging with Log4j -->
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.15.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.15.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
......@@ -170,13 +147,6 @@
</dependency>
<!-- Parsing, Bytecode, ... -->
<!-- Unused <dependency> <groupId>antlr</groupId> <artifactId>antlr</artifactId>
<version>2.7.6</version> </dependency> <dependency> <groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId> <version>3.2</version> </dependency>
<dependency> <groupId>javassist</groupId> <artifactId>javassist</artifactId>
<version>3.12.0.GA</version> </dependency> -->
<!-- Geometric calculations -->
<dependency>
<groupId>com.vividsolutions</groupId>
......@@ -185,15 +155,14 @@
</dependency>
<!-- Graphs -->
<dependency>
<groupId>thirdparty</groupId>
<artifactId>jgrapht-jdk1.6</artifactId>
<version>0.8.2</version>
<groupId>org.jgrapht</groupId>
<artifactId>jgrapht-core</artifactId>
<version>1.5.0</version>
</dependency>
<!-- Chart creation -->
<!-- unused? <dependency> <groupId>jfree</groupId> <artifactId>jcommon</artifactId>
<version>1.0.16</version> </dependency> -->
<!-- Chart creation -->
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
......@@ -213,9 +182,12 @@
<version>4.3.10.Final</version>
</dependency>
<!-- <dependency> <groupId>org.xerial</groupId> <artifactId>sqlite-jdbc</artifactId>
<version>3.7.2</version> </dependency> -->
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.7.2</version>
</dependency>
<!-- Glab Database -->
<dependency>
<groupId>org.hsqldb</groupId>
......@@ -239,13 +211,7 @@
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
<!-- OLD Math for some outdated classes -->
<!-- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math</artifactId>
<version>2.2</version>
</dependency>-->
<dependency>
<groupId>commons-net</groupId>
......@@ -259,31 +225,15 @@
</dependency>
<!-- SimCfg, Xtext, EMF dependencies -->
<!-- unused <dependency> <groupId>org.eclipse</groupId> <artifactId>xtext</artifactId>
<version>2.3.0</version> </dependency> <dependency> <groupId>org.eclipse</groupId>
<artifactId>xtext.util</artifactId> <version>2.3.0</version> </dependency>
<dependency> <groupId>org.eclipse.emf</groupId> <artifactId>ecore</artifactId>
<version>2.8.1</version> </dependency> <dependency> <groupId>org.eclipse.emf</groupId>
<artifactId>ecore.xmi</artifactId> <version>2.8.0</version> </dependency>
<dependency> <groupId>org.eclipse.emf</groupId> <artifactId>ecore.xmi</artifactId>
<version>2.8.0</version> </dependency> <dependency> <groupId>org.eclipse.emf</groupId>
<artifactId>common</artifactId> <version>2.8.0</version> </dependency> <dependency>
<groupId>org.eclipse</groupId> <artifactId>xtext.common.types</artifactId>
<version>2.3.0</version> </dependency> <dependency> <groupId>org.eclipse</groupId>
<artifactId>xtext.util</artifactId> <version>2.3.0</version> </dependency>
<dependency> <groupId>org.eclipse.emf</groupId> <artifactId>mwe2.runtime</artifactId>
<version>2.3.0</version> </dependency> <dependency> <groupId>org.eclipse.emf</groupId>
<artifactId>mwe.core</artifactId> <version>1.2.1</version> </dependency>
<dependency> <groupId>org.eclipse.emf</groupId> <artifactId>mwe.utils</artifactId>
<version>1.2.1</version> </dependency> -->
<!-- Math -->
<!-- https://mvnrepository.com/artifact/ca.umontreal.iro.simul/ssj -->
<dependency>
<groupId>umontreal.iro.lecuyer</groupId>
<artifactId>ssj</artifactId>
<version>1.1.9</version>
<groupId>ca.umontreal.iro.simul</groupId>
<artifactId>ssj</artifactId>
<version>3.3.1</version>
</dependency>
<!-- Date & Time calculations -->
<dependency>
<groupId>joda-time</groupId>
......@@ -297,11 +247,7 @@
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- unused <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId>
<version>1.0.4</version> </dependency> <dependency> <groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId> <version>1.2</version> </dependency>
<dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId>
<version>2.1</version> </dependency> -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
......@@ -313,17 +259,6 @@
<version>1.4.1</version>
</dependency>
<!-- <dependency> <groupId>com.baulsupp.kolja</groupId> <artifactId>jcurses</artifactId>
<version>0.9.5.3</version> </dependency> -->
<!-- Geodemlia -->
<!-- unused <dependency> <groupId>org.swinglabs</groupId> <artifactId>jxmapviewer</artifactId>
<version>1.0</version> </dependency> <dependency> <groupId>org.swinglabs</groupId>
<artifactId>swingx</artifactId> <version>1.6.1</version> </dependency> -->
<!-- JUNG Graph Library -->
<!-- unused<dependency> <groupId>net.sf.jung</groupId> <artifactId>jung2</artifactId>
<version>2.0.1</version> <type>pom</type> </dependency> -->
<dependency>
<groupId>net.sf.jung</groupId>
<artifactId>jung-api</artifactId>
......@@ -344,23 +279,20 @@
<artifactId>jung-io</artifactId>
<version>2.0.1</version>
</dependency>
<!-- unused <dependency> <groupId>net.sf.jung</groupId> <artifactId>jung-visualization</artifactId>
<version>2.0.1</version> </dependency> <dependency> <groupId>net.sf.jung</groupId>
<artifactId>jung-samples</artifactId> <version>2.0.1</version> </dependency> -->
<!-- OSM-Data for movement models -->
<dependency>
<groupId>com.graphhopper</groupId>
<artifactId>graphhopper</artifactId>
<version>0.7.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
<!-- OSM-Data for movement models -->
<dependency>
<groupId>com.graphhopper</groupId>
<artifactId>graphhopper-core</artifactId>
<version>0.13.0</version>
</dependency>
<dependency>
<groupId>com.graphhopper</groupId>
<artifactId>graphhopper-reader-osm</artifactId>
<version>0.13.0</version>
</dependency>
<!-- Json (used for OSM-Movement-Model) -->
<dependency>
<groupId>org.json</groupId>
......@@ -368,7 +300,6 @@
<version>20140107</version>
</dependency>
<!-- Simonstrator-Platform -->
<dependency>
<groupId>maki</groupId>
......@@ -380,8 +311,8 @@
<dependency>
<groupId>maki</groupId>
<artifactId>simonstrator-traci</artifactId>
<version>0.1-SNAPSHOT</version>
<version>0.2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
......@@ -94,4 +94,5 @@ public interface SimHost extends Host {
* binding with other layers, as these might have been null beforehand.
*/
public void initialize();
}
......@@ -18,7 +18,9 @@
*
*/
package de.tud.kom.p2psim.impl.energy;
package de.tud.kom.p2psim.api.energy;
/**
* This interface implements basic methods used by the EnergyModel to simulate a
......@@ -29,6 +31,15 @@ package de.tud.kom.p2psim.impl.energy;
*/
public interface Battery extends Cloneable {
public static double uJconverison = 1000000;
/**
* Returns the maximum energy level in uJ.
*
* @return the maximum capacity of the battery in uJ
*/
public double getMaximumEnergy();
/**
* Returns the current status of the Battery as a Percentage-Value
*
......@@ -41,7 +52,7 @@ public interface Battery extends Cloneable {
*
* @return the current capacity of the battery in uJ
*/
public double getCurrentEnergyLevel();
public double getCurrentEnergy();
/**
* Returns the consumed energy in uJoule
......@@ -53,7 +64,16 @@ public interface Battery extends Cloneable {
/**
* Resets the Battery to the initial Energy-Level
*/
public void reset();
default public void reset() {
throw new UnsupportedOperationException();
}
/**
* Resets the Battery to the maximum (full) Energy-Level
*/
default public void setToMaximumLoad() {
throw new UnsupportedOperationException();
}
/**
* Sets the battery to a given percentage.
......@@ -85,4 +105,13 @@ public interface Battery extends Cloneable {
* @return
*/
public Battery clone();
/**
* Returns true, if the battery is fully charged.
*
* @return
*/
public boolean isFullyCharged();
public Battery copy(double initialEnergy);
}
......@@ -52,6 +52,10 @@ public enum ComponentType {
/**
* Other components which consume energy
*/
BASIC
BASIC,
/**
* Actuators, Motors, Rotors
*/
ACTUATOR
}
......@@ -21,14 +21,15 @@
package de.tud.kom.p2psim.api.energy;
import de.tudarmstadt.maki.simonstrator.api.EventHandler;
import de.tudarmstadt.maki.simonstrator.api.Time;
/**
* A component that consumes energy (ie. a radio or a GPS-receiver).
* State-switching is event-based in this new version of the Model to allow more
* fine-grained analyzing.
*
* @author Bjoern Richerzhagen
* @version 1.0, 21.02.2012
* @author Bjoern Richerzhagen, Julian Zobel
* @version 1.1, 20.01.2020
*/
public interface EnergyComponent extends EventHandler {
......@@ -45,7 +46,7 @@ public interface EnergyComponent extends EventHandler {
* CommunicationComponent directly. Call goOffline() on the corresponding
* Mac-Layer instead!</b>
*/
public void turnOff();
public boolean turnOff();
/**
* Generic method to activate a component. <b>DO NOT use this method on a
......@@ -72,5 +73,9 @@ public interface EnergyComponent extends EventHandler {
* @param listener
*/
public void setEnergyEventListener(EnergyEventListener listener);
default double calculateEnergyConsumation(EnergyState state, long timeInState) {
return state.getEnergyConsumption() * ( (double) timeInState / (double) Time.SECOND);
}
}
......@@ -21,35 +21,26 @@
package de.tud.kom.p2psim.api.energy;
/**
* The {@link EnergyModel} registers via this listener with each
* {@link EnergyComponent}.
* This listener gives {@link EnergyComponent}s access to the {@link EnergyModel}.
*
* @author Bjoern Richerzhagen
* @version 1.0, 27.02.2012
* @author Julian Zobel
* @version 1.0, 07.09.2018
*/
public interface EnergyEventListener {
// TODO
/**
* Notify the Model that a component switched its state
* Notify the energy model that a component has consumed energy.
*
* @param component
* @param oldState
* @param newState
* @param timeSpentInOldState
* @param component The energy component that has consumed energy.
* @param consumedEnergy The amount of energy that was consumed by that component (uJ)
*/
public void switchedState(EnergyComponent component, EnergyState oldState,
EnergyState newState, long timeSpentInOldState);
public void componentConsumedEnergy(EnergyComponent component, double consumedEnergy);
/**
* Allows the energy model to check, if a component is able to be turned on.
* Return false, if the battery is empty or there is any other reason for
* the component not to be online.
* Allows a component to check, if it is able to be turned on.
*
* @param component
* @return
* @param component The energy component that is checked to be able to go online.
* @return False if there is any reason, that the component cannot be turned on; true if it can be turned on.
*/
public boolean turnOn(EnergyComponent component);
public boolean componentCanBeActivated(EnergyComponent component);
}
......@@ -20,8 +20,6 @@
package de.tud.kom.p2psim.api.energy;
import de.tud.kom.p2psim.impl.energy.Battery;
/**
* This interface is exported by the {@link EnergyModel} of a host to allow
* access to status information of the model and the battery. Within an
......
......@@ -55,7 +55,7 @@ public interface EnergyModel extends SimHostComponent {
*
* @return
*/
public EnergyInfo getInfo();
public EnergyInfo getEnergyInfo();
/**
* Save some casting and use this method to return all components of the
......
......@@ -2,17 +2,17 @@
* Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
*
* This file is part of PeerfactSim.KOM.
*
*
* PeerfactSim.KOM 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
* any later version.
*
*
* PeerfactSim.KOM 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.
*
*
* You should have received a copy of the GNU General Public License
* along with PeerfactSim.KOM. If not, see <http://www.gnu.org/licenses/>.
*
......@@ -31,12 +31,16 @@ import de.tudarmstadt.maki.simonstrator.api.component.network.NetworkComponent.N
* all parameter-related stuff has to be implemented in the {@link Link}. This
* enum is used throughout the new {@link LinkLayer} and also on application
* level if you want to explicitly specify which component to use.
*
*
* It provides basic defaults for MTU and Drop rates in the medium, which might
* be used inside the MacLayer or as part of a {@link Link}
*
*
* @author Bjoern Richerzhagen
* @version 1.0, 25.02.2012
*
* @author Julian Zobel
* added LoRa PHY
*
*/
public enum PhyType {
......@@ -44,16 +48,16 @@ public enum PhyType {
* Direct wireless connections between adjacent hosts or AP-based (decided
* by the MAC/TopologyView used). Based on
* "WiFi in Ad Hoc Mode: A Meaurement Study" by Anastasi et al. (2004),
*
*
* Assuming the following defaults: 1% drop-rate of LinkLayer-Packets
* (LinkLayer might add retransmission behavior as in 802.11), 5MBit/s netto
* (802.11b) BW, 500us latency, 2,2kB MTU, Broadcast
*/
WIFI(NetInterfaceName.WIFI, 0.01, 5 * Rate.Mbit_s, 500 * Time.MICROSECOND,
WIFI(NetInterfaceName.WIFI, 0.01, 12 * Rate.Mbit_s, 500 * Time.MICROSECOND,
2334, true),
/**
* A wired connection based on a TopologyView
*
*
* Assuming the following defaults: 0.1% link-layer loss, 100 Mbit/s, 1ms
* Link-Latency, 1,5kB MTU
*/
......@@ -71,14 +75,31 @@ public enum PhyType {
500 * Simulator.MICROSECOND_UNIT, 1472, false),
/**
*
*
* Bluetooth, short-ranged wireless transmissions between adjacent hosts
*
* Assuming the following defaults: zero link-layer packet loss, 3Mbit/s BW,
* 500us latency, 1kByte MTU
*/
BLUETOOTH(NetInterfaceName.BLUETOOTH, 0.0, 3 * Rate.Mbit_s,
500 * Simulator.MICROSECOND_UNIT, 1024, true);
500 * Simulator.MICROSECOND_UNIT, 1024, true),
/**
* WiFi for UAV communication
*/
WIFI_UAV_NET(NetInterfaceName.WIFI_UAV_NET, 0.01, 5 * Rate.Mbit_s,
500 * Time.MICROSECOND, 2334, true),
/**
* LoRa for LPWAN communication
*
* Assuming the following defaults: zero link-layer packet loss, 0.3 kbit/s BW,
* 500us latency, 1kByte MTU
*/
LORA(NetInterfaceName.LORA, 0, 300 * Rate.bit_s,
500 * Time.MICROSECOND, 1024, true);
private double defaultDropProbability;
......@@ -101,7 +122,7 @@ public enum PhyType {
private NetInterfaceName netInterfaceName;
/**
*
*
* @param defaultDropProbability
* @param defaultRawBW
* bw in bit/s
......@@ -133,7 +154,7 @@ public enum PhyType {
/**
* The Default BW of a link (unidirectional) in bit/s
*
*
* @return
*/
public long getDefaultBW() {
......@@ -144,7 +165,7 @@ public enum PhyType {
* has to return true if the medium is by its nature a broadcast medium (ie.
* sending a message will prohibit sending for all other hosts in range). If
* the medium supports Multiplexing such as UMTS, set this to false.
*
*
* @return
*/
public boolean isBroadcastMedium() {
......@@ -153,7 +174,7 @@ public enum PhyType {
/**
* Long-term replacement of PHY
*
*
* @return
*/
public NetInterfaceName getNetInterfaceName() {
......
......@@ -35,7 +35,11 @@ public enum NetProtocol {
/**
* Common known IPv4 network protocol, with a 20 byte header
*/
IPv4(20);
IPv4(20),
/**
* LoRaWAN with 12 byte header
*/
LORA(12);
private final int headerSize;
......
......@@ -25,7 +25,7 @@ import de.tud.kom.p2psim.api.topology.obstacles.ObstacleModel;
import de.tud.kom.p2psim.api.topology.social.SocialView;
import de.tud.kom.p2psim.api.topology.views.TopologyView;
import de.tud.kom.p2psim.api.topology.waypoints.WaypointModel;
import de.tud.kom.p2psim.impl.topology.PositionVector;
import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tudarmstadt.maki.simonstrator.api.component.GlobalComponent;
/**
......
......@@ -43,7 +43,7 @@ public interface TopologyComponent extends SimHostComponent,
*
* @return
* @deprecated use Binder.getComponent(Topology.class) instead!
*/
*/
@Deprecated
public Topology getTopology();
......
/*
* Copyright (c) 2005-2010 KOM � Multimedia Communications Lab
*
* This file is part of Simonstrator.KOM.
*
* Simonstrator.KOM 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
* any later version.
*
* PeerfactSim.KOM 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.
*
* You should have received a copy of the GNU General Public License
* along with PeerfactSim.KOM. If not, see <http://www.gnu.org/licenses/>.
*
*/
package de.tud.kom.p2psim.api.topology.component;
import java.util.LinkedList;
import de.tud.kom.p2psim.impl.topology.component.BaseTopologyComponent;
import de.tud.kom.p2psim.impl.topology.placement.UAVBasePlacement;
import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tudarmstadt.maki.simonstrator.api.uavsupport.Actuator;
import de.tudarmstadt.maki.simonstrator.api.uavsupport.callbacks.BaseConnectedCallback;
import de.tudarmstadt.maki.simonstrator.api.uavsupport.callbacks.BaseDisconnectedCallback;
import de.tudarmstadt.maki.simonstrator.api.uavsupport.callbacks.BatteryReplacementCallback;
import de.tudarmstadt.maki.simonstrator.api.uavsupport.callbacks.ReachedLocationCallback;
/**
* A controllable location actuator, that can be turned on and off, gives access
* to the current location and battery levels, and also receives a location for
* a target that the actuator will then approach.
*
* @author Julian Zobel
*
*/
public interface ControllableLocationActuator extends Actuator {
public boolean isActive();
public boolean activate();
public boolean deactivate();
public PositionVector getCurrentLocation();
public PositionVector getCurrentDirection();
public PositionVector getBaseLocation();
public void updateCurrentDirection(PositionVector direction);
public double getCurrentBatteryLevel();
public double getCurrentBatteryEnergy();
public double getMaximumBatteryCapacity();
public LinkedList<PositionVector> getTargetLocations();
public void setTargetLocation(PositionVector targetLocation, ReachedLocationCallback cb);
public void addTargetLocation(PositionVector targetLocation, ReachedLocationCallback cb);
public void setTargetLocationRoute(LinkedList<PositionVector> route, ReachedLocationCallback cb);
public void removeAllTargetLocations();
public void batteryReplacement(BatteryReplacementCallback cb);
public void returnToBase(ReachedLocationCallback cb);
public void connectToBase(BaseConnectedCallback cb);
public void disconnectFromBase(BaseDisconnectedCallback cb);
public void setMovementSpeed(double speed);
public double getMinMovementSpeed();
public double getMaxMovementSpeed();
public double getMovementSpeed();
public double estimatePowerConsumptionWatt(double velocity);
public double estimateFlightDistance(double velocity, double batterylevel, double batterythreshold);
}
......@@ -23,7 +23,7 @@ package de.tud.kom.p2psim.api.topology.movement;
import java.util.Set;
import de.tud.kom.p2psim.api.topology.TopologyComponent;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.AttractionPoint;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.IAttractionPoint;
/**
* A movement model for a group of {@link TopologyComponent}s. The movement
......@@ -61,7 +61,7 @@ public interface MovementModel {
* @param targetAttractionPoint
*/
default public void changeTargetLocation(SimLocationActuator actuator,
AttractionPoint targetAttractionPoint)
IAttractionPoint targetAttractionPoint)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
......@@ -75,7 +75,7 @@ public interface MovementModel {
* @param actuator
* @return target AttractionPoint
*/
default public AttractionPoint getTargetLocation(
default public IAttractionPoint getTargetLocation(
SimLocationActuator actuator) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
......@@ -86,7 +86,7 @@ public interface MovementModel {
* @return
* @throws UnsupportedOperationException
*/
default public Set<AttractionPoint> getAllAttractionPoints()
default public Set<IAttractionPoint> getAllAttractionPoints()
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
......
......@@ -20,7 +20,7 @@
package de.tud.kom.p2psim.api.topology.movement;
import de.tud.kom.p2psim.impl.topology.PositionVector;
import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.LocationActuator;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.LocationSensor;
......
......@@ -20,7 +20,7 @@
package de.tud.kom.p2psim.api.topology.movement;
import de.tud.kom.p2psim.impl.topology.PositionVector;
import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.LocationActuator;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.LocationSensor;
......
/*
* Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
*
* This file is part of PeerfactSim.KOM.
*
* PeerfactSim.KOM 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
* any later version.
*
* PeerfactSim.KOM 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.
*
* You should have received a copy of the GNU General Public License
* along with PeerfactSim.KOM. If not, see <http://www.gnu.org/licenses/>.
*
*/
package de.tud.kom.p2psim.api.topology.movement;
import de.tud.kom.p2psim.api.topology.component.ControllableLocationActuator;
import de.tud.kom.p2psim.impl.energy.components.StatefulActuatorComponent;
import de.tud.kom.p2psim.impl.energy.components.StatelessActuatorComponent;
public interface SimUAVLocationActuator extends SimLocationActuator, ControllableLocationActuator {
public UAVMovementModel getUAVMovement();
public void setUAVMovement(UAVMovementModel uavMovement);
}
/*
* Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
*
* This file is part of PeerfactSim.KOM.
*
* PeerfactSim.KOM 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
* any later version.
*
* PeerfactSim.KOM 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.
*
* You should have received a copy of the GNU General Public License
* along with PeerfactSim.KOM. If not, see <http://www.gnu.org/licenses/>.
*
*/
package de.tud.kom.p2psim.api.topology.movement;
import java.util.LinkedList;
import de.tud.kom.p2psim.impl.energy.components.ActuatorComponent;
import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tudarmstadt.maki.simonstrator.api.uavsupport.callbacks.ReachedLocationCallback;
/**
* UAV Movement Models provide basic functionality for the simulation of flying UAVs.
*
* @author Julian Zobel
* @version 1.0, 20.01.2020
*/
public interface UAVMovementModel {
// NO - NO CHANGY
public final double AIRDENSITY = 1.2045; // kg/m^3
public final double GRAVITY = 9.807; // m/s^2
public void setMotorControl(ActuatorComponent motor);
/**
* Set the preferred/target speed of this UAV.
*
* @param targetVelocity
*/
public void setTargetVelocity(double targetVelocity);
public double getVerticalAscentMaxVelocity();
public double getHorizontalMaxVelocity();
public double getCurrentVelocity();
public double getHorizontalMinVelocity();
/**
* Estimate the power consumption for a given velocity
* @param velocity
* @return The power consumption in W for the given velocity.
*/
public double estimatePowerConsumptionWatt(double velocity);
public void move(long timeBetweenMovementOperations);
public void setTargetLocation(PositionVector target, ReachedLocationCallback reachedLocationCallback);
public void setTargetLocationRoute(LinkedList<PositionVector> route, ReachedLocationCallback reachedLocationCallback);
public void addTargetLocation(PositionVector target, ReachedLocationCallback reachedLocationCallback);
/**
* Returns a copy of the current target locations
*
* @return
*/
public LinkedList<PositionVector> getTargetLocations();
public void removeTargetLocations();
}
......@@ -23,7 +23,7 @@ package de.tud.kom.p2psim.api.topology.movement.local;
import de.tud.kom.p2psim.api.topology.movement.SimLocationActuator;
import de.tud.kom.p2psim.api.topology.obstacles.ObstacleModel;
import de.tud.kom.p2psim.api.topology.waypoints.WaypointModel;
import de.tud.kom.p2psim.impl.topology.PositionVector;
import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.util.Either;
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment