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
af3f2cc6
Commit
af3f2cc6
authored
Jun 07, 2019
by
Julian Zobel
Browse files
Attraction Point Monitoring for eval
parent
d28bebc4
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/attraction/AttractionPointMonitor.java
0 → 100644
View file @
af3f2cc6
/*
* 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.impl.topology.movement.modularosm.attraction
;
import
de.tudarmstadt.maki.simonstrator.api.component.core.MonitorComponent.Analyzer
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.AttractionPoint
;
public
interface
AttractionPointMonitor
extends
Analyzer
{
public
void
addedAttractionPoint
(
AttractionPoint
ap
);
public
void
removedAttractionPoint
(
AttractionPoint
ap
);
}
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/attraction/CsvAttractionGenerator.java
View file @
af3f2cc6
...
...
@@ -100,7 +100,7 @@ public class CsvAttractionGenerator implements IAttractionGenerator {
}
AttractionPoint
ap
=
new
AttractionPointImpl
(
"AP"
+
i
,
new
PositionVector
(
x
,
y
));
ap
.
setRadius
(
radius
);
attractionPoint
s
.
add
(
ap
);
a
ddA
ttractionPoint
(
ap
);
i
++;
entrySuccessfullyRead
=
true
;
...
...
@@ -127,7 +127,7 @@ public class CsvAttractionGenerator implements IAttractionGenerator {
AttractionPoint
ap
=
new
AttractionPointImpl
(
"AP"
+
i
,
new
PositionVector
(
x
,
y
));
ap
.
setRadius
(
r
);
attractionPoint
s
.
add
(
ap
);
a
ddA
ttractionPoint
(
ap
);
i
++;
entrySuccessfullyRead
=
true
;
...
...
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/attraction/IAttractionGenerator.java
View file @
af3f2cc6
...
...
@@ -22,7 +22,7 @@ package de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction;
import
java.util.LinkedList
;
import
java.util.List
;
import
de.tudarmstadt.maki.simonstrator.api.Monitor
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.AttractionPoint
;
/**
...
...
@@ -37,4 +37,21 @@ public interface IAttractionGenerator {
public
List
<
AttractionPoint
>
getAttractionPoints
();
default
void
removeAttractionPoint
(
AttractionPoint
ap
)
{
if
(
Monitor
.
hasAnalyzer
(
AttractionPointMonitor
.
class
))
{
Monitor
.
getOrNull
(
AttractionPointMonitor
.
class
).
removedAttractionPoint
(
ap
);
}
attractionPoints
.
remove
(
ap
);
}
default
void
addAttractionPoint
(
AttractionPoint
ap
)
{
if
(
Monitor
.
hasAnalyzer
(
AttractionPointMonitor
.
class
))
{
Monitor
.
getOrNull
(
AttractionPointMonitor
.
class
).
addedAttractionPoint
(
ap
);
}
attractionPoints
.
add
(
ap
);
}
}
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