package cz.vutbr.feec.muller;

import java.util.Vector;

import cz.vutbr.feec.simlib.Simulation;

public class Main {
	public static void main(String[] args) {
		for (int k = 0; k < 5; k++) {
			final int RFT_PERIOD = 5000; 
			final int FT_PERIOD = 5000; 
			final int R_PERIOD = 5000; 
			//if(k==0)
			//System.out.println("jakub = [ ");
		
			System.out.println("jakub" +(k+1)+" = [ ");
			
			Simulation sim = new Simulation();

			// mnozina vsech R
			Vector<Receiver> receivers = new Vector<Receiver>();
			// Root feedback target
			RFT rft = new RFT(RFT_PERIOD);
			sim.addProcess(rft, 0);

			//
			for (int i = 0; i < 10; i++) {
				FT ft = new FT(FT_PERIOD);
				ft.setFeedback(rft);
				sim.addProcess(ft, 0);
				for (int j = 0; j < 10; j++) {
					Receiver receiver = new Receiver(1, R_PERIOD);
					receiver.setFeedback(ft);
					receivers.add(receiver);
					sim.addProcess(receiver, 0);
				}
			}
			rft.setReceivers(receivers);

			sim.start(5000 * 50);
			int ctr = 0;
			//if(k == 4)
			System.out.println("];");
		//	else
		//		System.out.println(";");
		}
		
	}
}
