public Node getNextNode(){
			if(transitions.isEmpty()) return null;
			double maxP = 0d;
			for(Transition t:transitions) maxP += t.p;
			double ran = random.nextDouble() * maxP;
			for(Transition t:transitions){
				if(ran > t.p){
					ran -= t.p;
				} else {
					return t.n;
				}
			}
			return transitions.getLast().n;
		}