removed creating unnecessary random generator

This commit is contained in:
fros4943 2009-02-18 10:40:25 +00:00
parent e907e4dace
commit 00c88ca2d3

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: UDGM.java,v 1.19 2009/02/18 10:11:32 fros4943 Exp $ * $Id: UDGM.java,v 1.20 2009/02/18 10:40:25 fros4943 Exp $
*/ */
package se.sics.cooja.radiomediums; package se.sics.cooja.radiomediums;
@ -92,7 +92,7 @@ public class UDGM extends AbstractRadioMedium {
private Simulation mySimulation; private Simulation mySimulation;
private Random random = new Random(); private Random random = null;
/** /**
* Visualizes radio traffic in the UDGM. Allows a user to * Visualizes radio traffic in the UDGM. Allows a user to
@ -601,8 +601,7 @@ public class UDGM extends AbstractRadioMedium {
return config; return config;
} }
public boolean setConfigXML(Collection<Element> configXML, public boolean setConfigXML(Collection<Element> configXML, boolean visAvailable) {
boolean visAvailable) {
for (Element element : configXML) { for (Element element : configXML) {
if (element.getName().equals("transmitting_range")) { if (element.getName().equals("transmitting_range")) {
TRANSMITTING_RANGE = Double.parseDouble(element.getText()); TRANSMITTING_RANGE = Double.parseDouble(element.getText());
@ -626,7 +625,6 @@ public class UDGM extends AbstractRadioMedium {
SUCCESS_RATIO_RX = Double.parseDouble(element.getText()); SUCCESS_RATIO_RX = Double.parseDouble(element.getText());
} }
} }
random = mySimulation.getRandomGenerator();
return true; return true;
} }