Commit 3a9f72cd authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Update

parent 1e657922
......@@ -2,17 +2,17 @@
* 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/>.
*
......@@ -56,7 +56,7 @@ import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor;
/**
* This factory is configured with one or more {@link TopologyView}s if the
* {@link LinkLayer} is used.
*
*
* @author Bjoern Richerzhagen, Julian Zobel
* @version 1.1, 06.09.2018
*/
......@@ -73,13 +73,13 @@ public class TopologyFactory implements HostComponentFactory {
* Movement model for the current group of hosts
*/
private MovementModel movement = new NoMovement();
private WaypointModel waypointModel;
private ObstacleModel obstacleModel;
private TopologyComponentFactory topologyComponentFactory = null;
private TopologyComponentFactory topologyComponentFactory = new DefaultTopologyComponent.Factory();
private boolean registerAsInformationProviderInSiS = false;
private static NetMeasurementDB measurementDB = null;
......@@ -95,11 +95,11 @@ public class TopologyFactory implements HostComponentFactory {
private boolean alreadyAddedMovement = false;
/**
*
*
*/
@XMLConfigurableConstructor({ "worldX", "worldY" })
public TopologyFactory(double worldX, double worldY) {
topo = new DefaultTopology(new PositionVector(worldX, worldY));
topo = new DefaultTopology(new PositionVector(worldX, worldY));
// Make the topology component available globally
Binder.registerComponent(topo);
}
......@@ -134,13 +134,13 @@ public class TopologyFactory implements HostComponentFactory {
* Create a TopologyComponent and register it with the Topology and its
* movement model.
*/
if(topologyComponentFactory == null) {
throw new UnsupportedOperationException("[TopologyFactory] Cannot create topology component, topology component factory is NULL");
}
}
TopologyComponent toCo = topologyComponentFactory.createTopologyComponent(host, topo, movement, placement, registerAsInformationProviderInSiS);
/*
* Need to register TopoViews as movement listeners, as they might need
* to update topologies after each movement.
......@@ -160,7 +160,7 @@ public class TopologyFactory implements HostComponentFactory {
/**
* Set the {@link PlacementModel} for this group of hosts
*
*
* @param placementModel
*/
public void setPlacement(PlacementModel placementModel) {
......@@ -192,7 +192,7 @@ public class TopologyFactory implements HostComponentFactory {
/**
* Add a {@link TopologyView}
*
*
* @param topologyView
*/
public void setView(TopologyView topologyView) {
......@@ -210,7 +210,7 @@ public class TopologyFactory implements HostComponentFactory {
/**
* Set the {@link MovementModel} for this group of hosts
*
*
* @param movement
*/
public void setMovement(MovementModel movement) {
......@@ -225,7 +225,7 @@ public class TopologyFactory implements HostComponentFactory {
/**
* For the {@link GNPLatency} and the {@link GNPPlacement}, a
* {@link NetMeasurementDB} is needed.
*
*
* @param db
*/
public void setMeasurementDB(NetMeasurementDB db) {
......@@ -241,11 +241,11 @@ public class TopologyFactory implements HostComponentFactory {
public void setUseRegionGroups(boolean useRegionGroups) {
TopologyFactory.useRegionGroups = useRegionGroups;
}
/**
* Option to enable the behavior of nodes registering as
* Option to enable the behavior of nodes registering as
* topology providers.
*
*
* @param registerAsLocationProviderInSiS
*/
public void setRegisterAsInformationProviderInSiS(
......@@ -257,7 +257,7 @@ public class TopologyFactory implements HostComponentFactory {
* Allows GNP-based strategies to retrieve the unique
* {@link NetMeasurementDB.Host} - as this object should only be created
* once per host, it is maintained in this static manner.
*
*
* @param host
* @return
*/
......@@ -270,7 +270,7 @@ public class TopologyFactory implements HostComponentFactory {
/**
* The Measurement-DB
*
*
* @return
*/
public static NetMeasurementDB getMeasurementDB() {
......@@ -283,9 +283,9 @@ public class TopologyFactory implements HostComponentFactory {
public ObstacleModel getObstacleModel() {
return obstacleModel;
}
public void setTopologyComponentFactory(TopologyComponentFactory factory) {
this.topologyComponentFactory = factory;
}
}
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