Commit ccc05c50 authored by Julian Zobel's avatar Julian Zobel
Browse files

UAV placement and registration of the base component to UAVs

parent 25e1ab23
......@@ -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;
}
}
......@@ -30,8 +30,8 @@ import de.tud.kom.p2psim.impl.topology.util.PositionVector;
public class UAVBasePlacement implements PlacementModel {
private static LinkedList<UAVTopologyComponent> uavs = new LinkedList<>();
private static BaseTopologyComponent base;
public static LinkedList<UAVTopologyComponent> uavs = new LinkedList<>();
public static BaseTopologyComponent base;
private static double baseX, baseY;
......
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment