BaseTopologyComponent.java 3.63 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * 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.component;

import java.util.Set;

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;
29
30
import de.tud.kom.p2psim.impl.energy.UAVReplacementCharger;
import de.tudarmstadt.maki.simonstrator.api.component.ComponentNotAvailableException;
31
import de.tudarmstadt.maki.simonstrator.api.component.overlay.OverlayComponent;
32
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.AttractionPoint;
Julian Zobel's avatar
Julian Zobel committed
33
34
import de.tudarmstadt.maki.simonstrator.api.uavsupport.BaseToUAVInterface;
import de.tudarmstadt.maki.simonstrator.api.uavsupport.UAVToBaseInterface;
35

36
37
38

public class BaseTopologyComponent extends AbstractTopologyComponent {

39
	private OverlayComponent baseOverlayComponent;
40
	private UAVReplacementCharger charger;
Julian Zobel's avatar
Julian Zobel committed
41
	private BaseToUAVInterface controllerInterface;
42
	
43
44
45
46
47
48
49
	public BaseTopologyComponent(SimHost host, Topology topology,
			MovementModel movementModel, PlacementModel placementModel,
			boolean registerAsInformationProviderInSiS) {
		super(host, topology, movementModel, placementModel,
				registerAsInformationProviderInSiS);
		// TODO Auto-generated constructor stub
	}
50
51
52
53
54
55
56
57
58
59
60
	
	@Override
	public void initialize() {		
		super.initialize();
		
		try {
			charger = getHost().getComponent(UAVReplacementCharger.class);
		} catch (ComponentNotAvailableException e) {
			throw new AssertionError("Unable to retrieve Replacement Charger for Base!");
		}
	}
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

	@Override
	public double getMinMovementSpeed() {
		throw new UnsupportedOperationException();
	}

	@Override
	public double getMaxMovementSpeed() {
		throw new UnsupportedOperationException();
	}

	@Override
	public double getMovementSpeed() {
		throw new UnsupportedOperationException();
	}

	@Override
	public void setMovementSpeed(double speed) {
		throw new UnsupportedOperationException();
	}

	@Override
	public Set<AttractionPoint> getAllAttractionPoints() {
		throw new UnsupportedOperationException();
	}
	
	@Override
	public void setTargetAttractionPoint(AttractionPoint targetAttractionPoint) {
		throw new UnsupportedOperationException();
	}

	@Override
	public AttractionPoint getCurrentTargetAttractionPoint() {
		throw new UnsupportedOperationException();
	}

97
98
99
	public void setOverlayComponent(OverlayComponent component) {
		this.baseOverlayComponent = component;
	}
100

101
102
103
	public OverlayComponent  getBaseComponent() {
		return baseOverlayComponent;
	}
104
105
106
107
108
	
	public UAVReplacementCharger getCharger() {
		return charger;
	}
	
Julian Zobel's avatar
Julian Zobel committed
109
110
111
112
113
114
115
116
117
118
119
	public void setControllerInterface(BaseToUAVInterface controllerInterface) {
		this.controllerInterface = controllerInterface;
	}
	
	public void connectUAVToBase(UAVToBaseInterface uav) {
		this.controllerInterface.connectUAVtoBase(uav);
	}
	
	public void disconnectUAVFromBase(UAVToBaseInterface uav) {
		this.controllerInterface.disconnectUAV(uav);
	}
120
}