private static boolean verifyRunningReplica(Task task, OurSim ourSim) {
		
		int running = 0;
		
		for (Replica replica : task.getReplicas()) {
			ExecutionState replicaState = replica.getState();

			if (ExecutionState.RUNNING.equals(replicaState) || ExecutionState.UNSTARTED.equals(replicaState)) {
				running++;
			}
		}
		
		int maxReplicas = ourSim.getIntProperty(Configuration.PROP_BROKER_MAX_REPLICAS);
		int maxSimultaneousReplicas = ourSim.getIntProperty(Configuration.PROP_BROKER_MAX_SIMULTANEOUS_REPLICAS);
		
		return task.getReplicas().size() < maxReplicas && running < maxSimultaneousReplicas
			&& (ExecutionState.RUNNING.equals(task.getState()) || ExecutionState.UNSTARTED.equals(task.getState()));
		
	}