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
0a1cfdb4
Commit
0a1cfdb4
authored
Jun 27, 2019
by
Tobias Meuser
Browse files
First working version of privacy-aware offloading
parent
040822f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tudarmstadt/maki/simonstrator/api/component/privacy/PrivacyLevel.java
View file @
0a1cfdb4
...
...
@@ -13,6 +13,7 @@ public class PrivacyLevel implements Comparable<PrivacyLevel> {
private
final
int
id
;
private
double
imprecisionAreaRadius
;
private
int
[]
responsibility
=
new
int
[
0
];
@XMLConfigurableConstructor
({
"imprecision"
})
public
PrivacyLevel
(
double
pImprecisionAreaRadius
)
{
...
...
@@ -22,6 +23,24 @@ public class PrivacyLevel implements Comparable<PrivacyLevel> {
imprecisionAreaRadius
=
pImprecisionAreaRadius
;
}
@XMLConfigurableConstructor
({
"imprecision"
,
"responsibility"
})
public
PrivacyLevel
(
double
pImprecisionAreaRadius
,
String
responsibility
)
{
synchronized
(
PrivacyLevel
.
class
)
{
id
=
staticID
++;
}
imprecisionAreaRadius
=
pImprecisionAreaRadius
;
String
[]
responsibilityLevels
;
if
(
responsibility
.
contains
(
";"
))
{
responsibilityLevels
=
responsibility
.
split
(
";"
);
}
else
{
responsibilityLevels
=
new
String
[
0
];
}
this
.
responsibility
=
new
int
[
responsibilityLevels
.
length
];
for
(
int
i
=
0
;
i
<
responsibilityLevels
.
length
;
i
++)
{
this
.
responsibility
[
i
]
=
Integer
.
valueOf
(
responsibilityLevels
[
i
]);
}
}
public
int
getId
()
{
return
id
;
}
...
...
@@ -35,6 +54,19 @@ public class PrivacyLevel implements Comparable<PrivacyLevel> {
return
id
;
}
public
void
setResponsibility
(
int
[]
responsibility
)
{
this
.
responsibility
=
responsibility
;
}
public
boolean
isResponsible
(
int
pState
)
{
for
(
int
i
=
0
;
i
<
responsibility
.
length
;
i
++)
{
if
(
responsibility
[
i
]
==
pState
)
{
return
true
;
}
}
return
false
;
}
@Override
public
boolean
equals
(
Object
pObj
)
{
if
(
pObj
instanceof
PrivacyLevel
)
{
...
...
src/de/tudarmstadt/maki/simonstrator/api/component/relevance/vehicular/VehicularRelevanceCalculationComponent.java
View file @
0a1cfdb4
...
...
@@ -33,7 +33,7 @@ import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.Road
* @version 1.0.0
*
*/
public
interface
VehicularRelevanceCalculationComponent
extends
HostComponent
{
public
interface
VehicularRelevanceCalculationComponent
extends
HostComponent
,
RelevanceCalculationComponent
{
public
enum
PositionRepresentation
{
ROAD_BASED
,
LOCATION_BASED
}
...
...
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/benefit/NodeProperties.java
View file @
0a1cfdb4
...
...
@@ -21,16 +21,27 @@
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.benefit
;
import
de.tudarmstadt.maki.simonstrator.api.common.graph.INodeID
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
public
class
NodeProperties
{
private
final
INodeID
_id
;
private
final
Location
_location
;
public
NodeProperties
(
INodeID
pId
)
{
this
(
pId
,
null
);
}
public
NodeProperties
(
INodeID
pId
,
Location
pLocation
)
{
_id
=
pId
;
_location
=
pLocation
;
}
public
INodeID
getId
()
{
return
_id
;
}
public
Location
getLocation
()
{
return
_location
;
}
}
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