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
ccc05c50
Commit
ccc05c50
authored
Sep 20, 2018
by
Julian Zobel
Browse files
UAV placement and registration of the base component to UAVs
parent
25e1ab23
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/component/BaseTopologyComponent.java
View file @
ccc05c50
...
...
@@ -26,11 +26,14 @@ import de.tud.kom.p2psim.api.common.SimHost;
import
de.tud.kom.p2psim.api.topology.Topology
;
import
de.tud.kom.p2psim.api.topology.movement.MovementModel
;
import
de.tud.kom.p2psim.api.topology.placement.PlacementModel
;
import
de.tudarmstadt.maki.simonstrator.api.component.overlay.OverlayComponent
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.AttractionPoint
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
public
class
BaseTopologyComponent
extends
AbstractTopologyComponent
{
private
OverlayComponent
baseOverlayComponent
;
public
BaseTopologyComponent
(
SimHost
host
,
Topology
topology
,
MovementModel
movementModel
,
PlacementModel
placementModel
,
boolean
registerAsInformationProviderInSiS
)
{
...
...
@@ -74,6 +77,11 @@ public class BaseTopologyComponent extends AbstractTopologyComponent {
throw
new
UnsupportedOperationException
();
}
public
void
setOverlayComponent
(
OverlayComponent
component
)
{
this
.
baseOverlayComponent
=
component
;
}
public
OverlayComponent
getBaseComponent
()
{
return
baseOverlayComponent
;
}
}
src/de/tud/kom/p2psim/impl/topology/placement/UAVBasePlacement.java
View file @
ccc05c50
...
...
@@ -30,8 +30,8 @@ import de.tud.kom.p2psim.impl.topology.util.PositionVector;
public
class
UAVBasePlacement
implements
PlacementModel
{
p
rivate
static
LinkedList
<
UAVTopologyComponent
>
uavs
=
new
LinkedList
<>();
p
rivate
static
BaseTopologyComponent
base
;
p
ublic
static
LinkedList
<
UAVTopologyComponent
>
uavs
=
new
LinkedList
<>();
p
ublic
static
BaseTopologyComponent
base
;
private
static
double
baseX
,
baseY
;
...
...
src/de/tud/kom/p2psim/impl/topology/util/PositionVector.java
View file @
ccc05c50
...
...
@@ -574,12 +574,7 @@ public class PositionVector implements Location {
* Calculates the angle using atan2 - this implies that the first
* two dimensions in your vector are the plane you are interested
* in.
*/
System
.
out
.
println
(
"dest is "
+
t
);
System
.
out
.
println
(
"y vec dif "
+
(
t
.
getEntry
(
1
)
-
this
.
getEntry
(
1
)));
System
.
out
.
println
(
"x vec dif "
+
(
t
.
getEntry
(
0
)
-
this
.
getEntry
(
0
)));
*/
return
(
float
)
Math
.
atan2
(
t
.
getEntry
(
1
)
-
this
.
getEntry
(
1
),
t
.
getEntry
(
0
)
-
this
.
getEntry
(
0
));
}
else
{
...
...
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