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

Update

parent 1e657922
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
* Copyright (c) 2005-2010 KOM – Multimedia Communications Lab * Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
* *
* This file is part of PeerfactSim.KOM. * This file is part of PeerfactSim.KOM.
* *
* PeerfactSim.KOM is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* any later version. * any later version.
* *
* PeerfactSim.KOM is distributed in the hope that it will be useful, * PeerfactSim.KOM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with PeerfactSim.KOM. If not, see <http://www.gnu.org/licenses/>. * along with PeerfactSim.KOM. If not, see <http://www.gnu.org/licenses/>.
* *
...@@ -56,7 +56,7 @@ import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor; ...@@ -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 * This factory is configured with one or more {@link TopologyView}s if the
* {@link LinkLayer} is used. * {@link LinkLayer} is used.
* *
* @author Bjoern Richerzhagen, Julian Zobel * @author Bjoern Richerzhagen, Julian Zobel
* @version 1.1, 06.09.2018 * @version 1.1, 06.09.2018
*/ */
...@@ -73,13 +73,13 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -73,13 +73,13 @@ public class TopologyFactory implements HostComponentFactory {
* Movement model for the current group of hosts * Movement model for the current group of hosts
*/ */
private MovementModel movement = new NoMovement(); private MovementModel movement = new NoMovement();
private WaypointModel waypointModel; private WaypointModel waypointModel;
private ObstacleModel obstacleModel; private ObstacleModel obstacleModel;
private TopologyComponentFactory topologyComponentFactory = null; private TopologyComponentFactory topologyComponentFactory = new DefaultTopologyComponent.Factory();
private boolean registerAsInformationProviderInSiS = false; private boolean registerAsInformationProviderInSiS = false;
private static NetMeasurementDB measurementDB = null; private static NetMeasurementDB measurementDB = null;
...@@ -95,11 +95,11 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -95,11 +95,11 @@ public class TopologyFactory implements HostComponentFactory {
private boolean alreadyAddedMovement = false; private boolean alreadyAddedMovement = false;
/** /**
* *
*/ */
@XMLConfigurableConstructor({ "worldX", "worldY" }) @XMLConfigurableConstructor({ "worldX", "worldY" })
public TopologyFactory(double worldX, double 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 // Make the topology component available globally
Binder.registerComponent(topo); Binder.registerComponent(topo);
} }
...@@ -134,13 +134,13 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -134,13 +134,13 @@ public class TopologyFactory implements HostComponentFactory {
* Create a TopologyComponent and register it with the Topology and its * Create a TopologyComponent and register it with the Topology and its
* movement model. * movement model.
*/ */
if(topologyComponentFactory == null) { if(topologyComponentFactory == null) {
throw new UnsupportedOperationException("[TopologyFactory] Cannot create topology component, topology component factory is NULL"); throw new UnsupportedOperationException("[TopologyFactory] Cannot create topology component, topology component factory is NULL");
} }
TopologyComponent toCo = topologyComponentFactory.createTopologyComponent(host, topo, movement, placement, registerAsInformationProviderInSiS); TopologyComponent toCo = topologyComponentFactory.createTopologyComponent(host, topo, movement, placement, registerAsInformationProviderInSiS);
/* /*
* Need to register TopoViews as movement listeners, as they might need * Need to register TopoViews as movement listeners, as they might need
* to update topologies after each movement. * to update topologies after each movement.
...@@ -160,7 +160,7 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -160,7 +160,7 @@ public class TopologyFactory implements HostComponentFactory {
/** /**
* Set the {@link PlacementModel} for this group of hosts * Set the {@link PlacementModel} for this group of hosts
* *
* @param placementModel * @param placementModel
*/ */
public void setPlacement(PlacementModel placementModel) { public void setPlacement(PlacementModel placementModel) {
...@@ -192,7 +192,7 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -192,7 +192,7 @@ public class TopologyFactory implements HostComponentFactory {
/** /**
* Add a {@link TopologyView} * Add a {@link TopologyView}
* *
* @param topologyView * @param topologyView
*/ */
public void setView(TopologyView topologyView) { public void setView(TopologyView topologyView) {
...@@ -210,7 +210,7 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -210,7 +210,7 @@ public class TopologyFactory implements HostComponentFactory {
/** /**
* Set the {@link MovementModel} for this group of hosts * Set the {@link MovementModel} for this group of hosts
* *
* @param movement * @param movement
*/ */
public void setMovement(MovementModel movement) { public void setMovement(MovementModel movement) {
...@@ -225,7 +225,7 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -225,7 +225,7 @@ public class TopologyFactory implements HostComponentFactory {
/** /**
* For the {@link GNPLatency} and the {@link GNPPlacement}, a * For the {@link GNPLatency} and the {@link GNPPlacement}, a
* {@link NetMeasurementDB} is needed. * {@link NetMeasurementDB} is needed.
* *
* @param db * @param db
*/ */
public void setMeasurementDB(NetMeasurementDB db) { public void setMeasurementDB(NetMeasurementDB db) {
...@@ -241,11 +241,11 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -241,11 +241,11 @@ public class TopologyFactory implements HostComponentFactory {
public void setUseRegionGroups(boolean useRegionGroups) { public void setUseRegionGroups(boolean useRegionGroups) {
TopologyFactory.useRegionGroups = useRegionGroups; TopologyFactory.useRegionGroups = useRegionGroups;
} }
/** /**
* Option to enable the behavior of nodes registering as * Option to enable the behavior of nodes registering as
* topology providers. * topology providers.
* *
* @param registerAsLocationProviderInSiS * @param registerAsLocationProviderInSiS
*/ */
public void setRegisterAsInformationProviderInSiS( public void setRegisterAsInformationProviderInSiS(
...@@ -257,7 +257,7 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -257,7 +257,7 @@ public class TopologyFactory implements HostComponentFactory {
* Allows GNP-based strategies to retrieve the unique * Allows GNP-based strategies to retrieve the unique
* {@link NetMeasurementDB.Host} - as this object should only be created * {@link NetMeasurementDB.Host} - as this object should only be created
* once per host, it is maintained in this static manner. * once per host, it is maintained in this static manner.
* *
* @param host * @param host
* @return * @return
*/ */
...@@ -270,7 +270,7 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -270,7 +270,7 @@ public class TopologyFactory implements HostComponentFactory {
/** /**
* The Measurement-DB * The Measurement-DB
* *
* @return * @return
*/ */
public static NetMeasurementDB getMeasurementDB() { public static NetMeasurementDB getMeasurementDB() {
...@@ -283,9 +283,9 @@ public class TopologyFactory implements HostComponentFactory { ...@@ -283,9 +283,9 @@ public class TopologyFactory implements HostComponentFactory {
public ObstacleModel getObstacleModel() { public ObstacleModel getObstacleModel() {
return obstacleModel; return obstacleModel;
} }
public void setTopologyComponentFactory(TopologyComponentFactory factory) { public void setTopologyComponentFactory(TopologyComponentFactory factory) {
this.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