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
b054079d
Commit
b054079d
authored
Oct 21, 2015
by
Björn Richerzhagen
Browse files
Added new SiSTypes
Added convenience method for one-ID sets in INodeID
parent
20101530
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tudarmstadt/maki/simonstrator/api/common/graph/INodeID.java
View file @
b054079d
...
...
@@ -21,7 +21,9 @@
package
de.tudarmstadt.maki.simonstrator.api.common.graph
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashSet
;
import
java.util.Map
;
import
java.util.Set
;
import
de.tudarmstadt.maki.simonstrator.api.common.UniqueID
;
...
...
@@ -61,6 +63,18 @@ public class INodeID implements UniqueID {
}
return
id
;
}
/**
* Convenience method returns a set containing only one id
*
* @param id
* @return
*/
public
static
Set
<
INodeID
>
getSingleIDSet
(
INodeID
id
)
{
Set
<
INodeID
>
set
=
new
LinkedHashSet
<>();
set
.
add
(
id
);
return
set
;
}
/**
* Private constructor
...
...
src/de/tudarmstadt/maki/simonstrator/api/component/sis/type/SiSTypes.java
View file @
b054079d
...
...
@@ -25,6 +25,7 @@ import java.util.Map;
import
de.tudarmstadt.maki.simonstrator.api.Monitor
;
import
de.tudarmstadt.maki.simonstrator.api.Monitor.Level
;
import
de.tudarmstadt.maki.simonstrator.api.common.graph.Graph
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.sis.type.aggregation.AbstractAggregation.AggregationDouble
;
...
...
@@ -55,6 +56,19 @@ public final class SiSTypes {
public
static
final
SiSType
<
Location
>
PHY_LOCATION
=
create
(
"PHY_LOCATION"
,
Location
.
class
,
null
);
/**
* Graph containing the physical neighborhood of a node according to a
* topologyProvider
*/
public
static
final
SiSType
<
Graph
>
PHY_TOPOLOGY
=
create
(
"PHY_TOPOLOGY"
,
Graph
.
class
,
null
);
/**
* Energy (percentage) as double from 0 to 100
*/
public
static
final
SiSType
<
Double
>
ENERGY_BATTERY_LEVEL
=
create
(
"ENERGY_BATTERY_LEVEL"
,
Double
.
class
,
new
AggregationDouble
());
/**
* [none] Just a dummy Test attribute of type double. Do not use in
* production code.
...
...
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