fixed a issue where we couldnt add the initNodeCount at the beginning
This commit is contained in:
parent
1acd532363
commit
f70f425564
@ -9,10 +9,10 @@ import java.util.logging.LogManager;
|
||||
import node.Node;
|
||||
|
||||
public class RandomGenerator {
|
||||
public static int initNodeCount = 10;
|
||||
public static int initNodeCount = 20;
|
||||
public static double initBirthRate = 0.50;
|
||||
public static double initDeathRate = 0.20;
|
||||
public static int initRounds = 10;
|
||||
public static int initRounds = 13;
|
||||
|
||||
public static List<Node> nodes = new ArrayList<Node>();
|
||||
public static Random gen = new Random();
|
||||
@ -25,7 +25,8 @@ public class RandomGenerator {
|
||||
|
||||
System.setProperty("java.util.logging.config.file",
|
||||
"logging.properties");
|
||||
|
||||
|
||||
nodes.add(new Node());
|
||||
add(initNodeCount);
|
||||
|
||||
try {
|
||||
@ -47,7 +48,7 @@ public class RandomGenerator {
|
||||
|
||||
switch (cmd) {
|
||||
case "br":
|
||||
nodes.get(count).gatherInformationOfNetwork();
|
||||
//
|
||||
break;
|
||||
case "add":
|
||||
add(count);
|
||||
@ -84,10 +85,10 @@ public class RandomGenerator {
|
||||
case "go":
|
||||
for (int i = 0; i < initRounds; i++) {
|
||||
System.out.println("Round: " + (i + 1));
|
||||
System.out.println("Nodecount: " + nodes.size());
|
||||
int oldsize = nodes.size();
|
||||
add((int) Math.round(oldsize * initBirthRate));
|
||||
remove((int) Math.round(oldsize * initDeathRate));
|
||||
System.out.println("Nodecount: " + nodes.size());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user