private void readEvents(BufferedReader reader) throws IOException {
		for(int i=0; i<nEvents; i++) {
			String line = reader.readLine();
			String[] fields = line.split(":");
			int id = Integer.parseInt(fields[0]);
			String type = fields[1];
			if(type.equals("O")) {
				String name = fields[2];
				int idBranch = Integer.parseInt(fields[3]);
				double time = Double.parseDouble(fields[4]);
				int idSon = Integer.parseInt(fields[5]);
				Event origination = Event.createOrigination(id, name, nodes.get(idBranch), time, events.get(idSon));
				originations.add(origination);
				events.put(id, origination);
				in.get(origination.getBranch()).add(origination);				
			}
			if(type.equals("S")) {
				int idBranch = Integer.parseInt(fields[2]);
				int idSon1 = Integer.parseInt(fields[3]);
				int idSon2 = Integer.parseInt(fields[4]);
				Event event = Event.createSpeciationOnNode(id, nodes.get(idBranch), events.get(idSon1), events.get(idSon2));
				events.put(id, event);
				in.get(event.getSon1().getBranch()).add(event.getSon1());
				in.get(event.getSon2().getBranch()).add(event.getSon2());
			}
			if(type.equals("SL")) {
				int idBranch = Integer.parseInt(fields[2]);
				int idSon = Integer.parseInt(fields[3]);
				Event event = Event.createSpeciationLossOnNode(id, nodes.get(idBranch), events.get(idSon));
				events.put(id, event);
				in.get(event.getSon1().getBranch()).add(event.getSon1());
			}
			if(type.equals("D")) {
				int idBranch = Integer.parseInt(fields[2]);
				double time = Double.parseDouble(fields[3]);
				int idSon1 = Integer.parseInt(fields[4]);
				int idSon2 = Integer.parseInt(fields[5]);
				Event event = Event.createDuplication(id, nodes.get(idBranch), time, events.get(idSon1), events.get(idSon2));
				events.put(id, event);
			}
			if(type.equals("Sb")) {
				int idBranch = Integer.parseInt(fields[2]);
				double time = Double.parseDouble(fields[3]);
				int idSon1 = Integer.parseInt(fields[4]);
				int idSon2 = Integer.parseInt(fields[5]);
				Event event = Event.createSpeciationOnBranch(id, nodes.get(idBranch), time, events.get(idSon1), events.get(idSon2));
				events.put(id, event);
				in.get(out).add(event.getSon2());
			}
			if(type.equals("SLb")) {
				int idBranch = Integer.parseInt(fields[2]);
				double time = Double.parseDouble(fields[3]);
				int idSon = Integer.parseInt(fields[4]);
				Event event = Event.createSpeciationLossOnBranch(id, nodes.get(idBranch), time, events.get(idSon));
				events.put(id, event);
				in.get(out).add(event.getSon1());
			}
			if(type.equals("T")) {
				int idBranch = Integer.parseInt(fields[2]);
				double time = Double.parseDouble(fields[3]);
				int idSon1 = Integer.parseInt(fields[4]);
				int idSon2 = Integer.parseInt(fields[5]);
				Event event = Event.createTransfer(id, nodes.get(idBranch), time, events.get(idSon1), events.get(idSon2));
				events.put(id, event);
				in.get(event.getSon2().getBranch()).add(event.getSon2());
			}
			if(type.equals("TL")) {
				int idBranch = Integer.parseInt(fields[2]);
				double time = Double.parseDouble(fields[3]);
				int idSon = Integer.parseInt(fields[4]);
				Event event = Event.createTransferLoss(id, nodes.get(idBranch), time, events.get(idSon));
				events.put(id, event);
				in.get(event.getSon1().getBranch()).add(event.getSon1());
			}
			
			
		}
	}