Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
1fb6c66c
Commit
1fb6c66c
authored
Dec 01, 2020
by
Christian Cabrera
Browse files
updating branch
parent
18e69bcf
Changes
263
Hide whitespace changes
Inline
Side-by-side
.settings/org.eclipse.core.resources.prefs
View file @
1fb6c66c
eclipse.preferences.version=1
encoding/<project>=UTF-8
encoding/pom.xml=UTF-8
encoding/src=UTF-8
.settings/org.eclipse.jdt.core.prefs
View file @
1fb6c66c
...
...
@@ -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
...
...
pom.xml
View file @
1fb6c66c
...
...
@@ -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,25 +59,42 @@
<updatePolicy>
always
</updatePolicy>
</releases>
</repository>
<!-- local kom repository -->
<!-- <repository>
<!--
<repository>
<id>maven.kom</id>
<url>http://www.kom.tu-darmstadt.de/~stingl/PeerfactSim.KOM-Libraries/maven2/</url>
</repository> -->
</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>
</repository>
-->
<repository>
<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>
...
...
@@ -115,16 +102,31 @@
<dependencies>
<!-- XML -->
<!-- https://mvnrepository.com/artifact/javax.xml/jsr173 -->
<dependency>
<groupId>
javax.xml
</groupId>
<artifactId>
jsr173
</artifactId>
<version>
1.0
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/stax/stax -->
<dependency>
<groupId>
dom4j
</groupId>
<artifactId>
dom4j
</artifactId>
<version>
1.
6.1
</version>
<groupId>
stax
</groupId>
<artifactId>
stax
</artifactId>
<version>
1.
2.0
</version>
</dependency>
<dependency>
<groupId>
stax
</groupId>
<artifactId>
utils
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
xerces
</groupId>
<artifactId>
xercesImpl
</artifactId>
...
...
@@ -145,7 +147,7 @@
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.
0
</version>
<version>
4.
13
</version>
</dependency>
<dependency>
<groupId>
junit-addons
</groupId>
...
...
@@ -153,10 +155,7 @@
<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 -->
<dependency>
<groupId>
log4j
</groupId>
<artifactId>
log4j
</artifactId>
...
...
@@ -185,12 +184,19 @@
</dependency>
<!-- Graphs -->
<!--
<dependency>
<groupId>thirdparty</groupId>
<artifactId>jgrapht-jdk1.6</artifactId>
<version>0.8.2</version>
</dependency>
-->
<dependency>
<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> -->
...
...
@@ -213,9 +219,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>
...
...
@@ -278,11 +287,19 @@
<version>1.2.1</version> </dependency> -->
<!-- Math -->
<!-- https://mvnrepository.com/artifact/ca.umontreal.iro.simul/ssj -->
<dependency>
<groupId>
ca.umontreal.iro.simul
</groupId>
<artifactId>
ssj
</artifactId>
<version>
3.3.1
</version>
</dependency>
<!--
<dependency>
<groupId>umontreal.iro.lecuyer</groupId>
<artifactId>ssj</artifactId>
<version>1.1.9</version>
</dependency>
-->
<!-- Date & Time calculations -->
<dependency>
...
...
@@ -297,6 +314,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>
...
...
@@ -349,10 +367,11 @@
<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>
<version>0.
8
.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
...
...
@@ -360,7 +379,19 @@
</exclusion>
</exclusions>
</dependency>
-->
<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>
...
...
@@ -380,8 +411,7 @@
<dependency>
<groupId>
maki
</groupId>
<artifactId>
simonstrator-traci
</artifactId>
<version>
0.
1
-SNAPSHOT
</version>
<version>
0.
2
-SNAPSHOT
</version>
</dependency>
</dependencies>
</project>
src/de/tud/kom/p2psim/api/common/SimHost.java
View file @
1fb6c66c
...
...
@@ -94,4 +94,5 @@ public interface SimHost extends Host {
* binding with other layers, as these might have been null beforehand.
*/
public
void
initialize
();
}
src/de/tud/kom/p2psim/api/energy/Battery.java
0 → 100644
View file @
1fb6c66c
/*
* 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.energy
;
/**
* This interface implements basic methods used by the EnergyModel to simulate a
* battery.
*
* @author Fabio Zöllner
* @version 1.0, 20.04.2012
*/
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
*
* @return double between 0 and 100
*/
public
double
getCurrentPercentage
();
/**
* Returns the current energy level in uJ.
*
* @return the current capacity of the battery in uJ
*/
public
double
getCurrentEnergy
();
/**
* Returns the consumed energy in uJoule
*
* @return The consumed Energy in uJoule
*/
public
double
getConsumedEnergy
();
/**
* Resets the Battery to the initial Energy-Level
*/
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.
*
* @param double between 0 and 100
*/
public
void
setToPercentage
(
double
percentage
);
/**
* Consumes the given amount of energy in uJoule (10^-6)
*
* @param energy
* Energy in uJoule
*/
public
void
consumeEnergy
(
double
energy
);
/**
* Returns true, if the battery is empty. In such a case, there should be no
* further calls to consumeEnergy.
*
* @return
*/
public
boolean
isEmpty
();
/**
* Clone a battery, used during configuration
*
* @param battery
* @return
*/
public
Battery
clone
();
/**
* Returns true, if the battery is fully charged.
*
* @return
*/
public
boolean
isFullyCharged
();
public
Battery
copy
(
double
initialEnergy
);
}
src/de/tud/kom/p2psim/api/energy/ComponentType.java
View file @
1fb6c66c
...
...
@@ -52,6 +52,10 @@ public enum ComponentType {
/**
* Other components which consume energy
*/
BASIC
BASIC
,
/**
* Actuators, Motors, Rotors
*/
ACTUATOR
}
src/de/tud/kom/p2psim/api/energy/EnergyComponent.java
View file @
1fb6c66c
...
...
@@ -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
, 2
1
.0
2
.20
1
2
* @author Bjoern Richerzhagen
, Julian Zobel
* @version 1.
1
, 2
0
.0
1
.202
0
*/
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
);
}
}
src/de/tud/kom/p2psim/api/energy/EnergyEventListener.java
View file @
1fb6c66c
...
...
@@ -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,
2
7.0
2
.201
2
* @author
Julian Zobel
* @version 1.0,
0
7.0
9
.201
8
*/
public
interface
EnergyEventListener
{
// TODO
/**
* Notify the
M
odel that a component
switched its state
* Notify the
energy m
odel 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
);
}
src/de/tud/kom/p2psim/api/energy/EnergyInfo.java
View file @
1fb6c66c
...
...
@@ -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
...
...
src/de/tud/kom/p2psim/api/energy/EnergyModel.java
View file @
1fb6c66c
...
...
@@ -55,7 +55,7 @@ public interface EnergyModel extends SimHostComponent {
*
* @return
*/
public
EnergyInfo
getInfo
();
public
EnergyInfo
get
Energy
Info
();
/**
* Save some casting and use this method to return all components of the
...
...
src/de/tud/kom/p2psim/api/linklayer/mac/PhyType.java
View file @
1fb6c66c
...
...
@@ -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
()
{
...
...
src/de/tud/kom/p2psim/api/network/NetProtocol.java
View file @
1fb6c66c
...
...
@@ -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
;
...
...
src/de/tud/kom/p2psim/api/topology/Topology.java
View file @
1fb6c66c
...
...
@@ -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
;
/**
...
...
src/de/tud/kom/p2psim/api/topology/TopologyComponent.java
View file @
1fb6c66c
...
...
@@ -43,7 +43,7 @@ public interface TopologyComponent extends SimHostComponent,
*
* @return
* @deprecated use Binder.getComponent(Topology.class) instead!
*/
*/
@Deprecated
public
Topology
getTopology
();
...
...
src/de/tud/kom/p2psim/api/topology/component/ControllableLocationActuator.java
0 → 100644
View file @
1fb6c66c
/*
* 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
);
}
src/de/tud/kom/p2psim/api/topology/movement/MovementModel.java
View file @
1fb6c66c
...
...
@@ -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.
I
AttractionPoint
;
/**
* 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
)
I
AttractionPoint
targetAttractionPoint
)
throws
UnsupportedOperationException
{
throw
new
UnsupportedOperationException
();
}
...
...
@@ -75,7 +75,7 @@ public interface MovementModel {
* @param actuator
* @return target AttractionPoint
*/
default
public
AttractionPoint
getTargetLocation
(
default
public
I
AttractionPoint
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
<
I
AttractionPoint
>
getAllAttractionPoints
()
throws
UnsupportedOperationException
{
throw
new
UnsupportedOperationException
();
}
...
...
src/de/tud/kom/p2psim/api/topology/movement/MovementSupported.java
View file @
1fb6c66c
...
...
@@ -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
;
...
...
src/de/tud/kom/p2psim/api/topology/movement/SimLocationActuator.java
View file @
1fb6c66c
...
...
@@ -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
;
...
...
src/de/tud/kom/p2psim/api/topology/movement/SimUAVLocationActuator.java
0 → 100644
View file @
1fb6c66c
/*
* 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
);
}
src/de/tud/kom/p2psim/api/topology/movement/UAVMovementModel.java
0 → 100644
View file @
1fb6c66c
/*
* 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
();
}
Prev
1
2
3
4
5
…
14
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment