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
API
Commits
5f338d24
Commit
5f338d24
authored
Sep 10, 2019
by
Julian Zobel
Browse files
Merge branch 'jz/dev-metrics' into jz/master
parents
be8335ae
f5965c83
Changes
6
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
5f338d24
...
...
@@ -95,5 +95,10 @@
<artifactId>
guava
</artifactId>
<version>
18.0
</version>
</dependency>
<dependency>
<groupId>
javax.xml.bind
</groupId>
<artifactId>
jaxb-api
</artifactId>
<version>
2.3.1
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
src/de/tudarmstadt/maki/simonstrator/api/component/pubsub/analyzer/NotificationInfo.java
View file @
5f338d24
...
...
@@ -20,14 +20,6 @@
package
de.tudarmstadt.maki.simonstrator.api.component.pubsub.analyzer
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Set
;
import
de.tudarmstadt.maki.simonstrator.api.Time
;
/**
* An object that can be attached to a notification to enable easier analyzing
* in simulation mode.
...
...
@@ -67,6 +59,13 @@ public interface NotificationInfo {
*/
public
long
getTimestampOfCreation
();
/**
* The time this notification is valid seen from the timestamp of creation.
*
* @return
*/
public
long
getTimeToLive
();
/**
* A sequence number for notifications, this can be used to detect missing
* notifications. Only to be used for analyzing.
...
...
@@ -95,81 +94,5 @@ public interface NotificationInfo {
public
boolean
hasMarker
(
Class
<?>
markerClass
,
long
marker
);
public
class
DefaultNotificationInfo
implements
NotificationInfo
{
private
final
long
payloadSize
;
private
final
long
originatorHostId
;
private
final
long
timestampOfCreation
;
private
final
Set
<
Long
>
hostIdsDeliveredTo
;
private
final
Map
<
Class
<?>,
Set
<
Long
>>
markers
;
private
final
long
sequenceNumber
;
private
static
Map
<
Long
,
Long
>
hostSequenceNumbers
=
new
LinkedHashMap
<
Long
,
Long
>();
public
DefaultNotificationInfo
(
long
payloadSize
,
long
originatorHostId
)
{
this
.
payloadSize
=
payloadSize
;
this
.
originatorHostId
=
originatorHostId
;
this
.
timestampOfCreation
=
Time
.
getCurrentTime
();
this
.
hostIdsDeliveredTo
=
new
HashSet
<
Long
>();
this
.
markers
=
new
HashMap
<
Class
<?>,
Set
<
Long
>>();
if
(
hostSequenceNumbers
.
containsKey
(
originatorHostId
))
{
this
.
sequenceNumber
=
hostSequenceNumbers
.
get
(
originatorHostId
);
}
else
{
this
.
sequenceNumber
=
0
;
}
hostSequenceNumbers
.
put
(
originatorHostId
,
this
.
sequenceNumber
+
1
);
}
/**
* Marks the notification as being delivered to the given host. Method
* returns false, if the notification is a duplicate.
*
* @param hostId
* @return
*/
public
boolean
markAsDelivered
(
long
hostId
)
{
return
this
.
hostIdsDeliveredTo
.
add
(
hostId
);
}
@Override
public
void
setMarker
(
Class
<?>
markerClass
,
long
marker
)
{
Set
<
Long
>
cMarkers
=
markers
.
get
(
markerClass
);
if
(
cMarkers
==
null
)
{
cMarkers
=
new
HashSet
<
Long
>();
markers
.
put
(
markerClass
,
cMarkers
);
}
cMarkers
.
add
(
marker
);
}
@Override
public
boolean
hasMarker
(
Class
<?>
markerClass
,
long
number
)
{
return
this
.
markers
.
containsKey
(
markerClass
)
&&
this
.
markers
.
get
(
markerClass
).
contains
(
number
);
}
@Override
public
long
getNotificationPayloadSize
()
{
return
payloadSize
;
}
@Override
public
long
getOriginatorHostId
()
{
return
originatorHostId
;
}
@Override
public
long
getTimestampOfCreation
()
{
return
timestampOfCreation
;
}
@Override
public
long
getSequenceNumber
()
{
return
sequenceNumber
;
}
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/location/Location.java
View file @
5f338d24
...
...
@@ -32,7 +32,7 @@ import de.tudarmstadt.maki.simonstrator.api.common.Transmitable;
*
* @see http://developer.android.com/reference/android/location/Location.html
*
* @author Bjoern Richerzhagen
* @author Bjoern Richerzhagen
, Julian Zobel
*
*/
public
interface
Location
extends
Transmitable
,
Cloneable
{
...
...
src/de/tudarmstadt/maki/simonstrator/api/uavsupport/UAVControl.java
View file @
5f338d24
...
...
@@ -52,7 +52,7 @@ public interface UAVControl extends CommunicationInterfaceListener {
public
OverlayContact
getOverlayContact
(
NetInterfaceName
network
);
public
OverlayContact
getBaseOverla
c
Contact
();
public
OverlayContact
getBaseOverla
y
Contact
();
public
Location
getCurrentLocation
();
...
...
@@ -70,4 +70,8 @@ public interface UAVControl extends CommunicationInterfaceListener {
public
void
strategyTerminated
();
public
Host
getHost
();
public
double
getReturnThreshold
();
public
double
getRechargeThreshold
();
}
src/de/tudarmstadt/maki/simonstrator/api/uavsupport/communication/ConnectionInformation.java
View file @
5f338d24
...
...
@@ -42,4 +42,5 @@ public interface ConnectionInformation {
public
OverlayContact
getConnectionInformation
(
NetInterfaceName
networkInterface
);
public
INodeID
getID
();
}
src/de/tudarmstadt/maki/simonstrator/api/uavsupport/communication/UAVToBaseInterface.java
View file @
5f338d24
package
de.tudarmstadt.maki.simonstrator.api.uavsupport.communication
;
import
de.tudarmstadt.maki.simonstrator.api.Host
;
import
de.tudarmstadt.maki.simonstrator.api.uavsupport.Actuator
;
import
de.tudarmstadt.maki.simonstrator.api.uavsupport.strategy.UAVStrategy
;
public
interface
UAVToBaseInterface
{
...
...
@@ -11,4 +13,10 @@ public interface UAVToBaseInterface {
public
void
startStrategy
();
public
ConnectionInformation
getConnectionInformation
();
public
Actuator
getActuatorAccess
();
public
double
getReturnThreshold
();
public
Host
getHost
();
}
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