public Agent(InfluenceMatrix inf,
			ArrayList<HashSet<Integer>> iterationPlan, int processingPower,
			String type, int totalNum, double constraint, boolean isAveraging,
			boolean isExhaustive
	/*
	 * , boolean isRefactoringAll
	 */) {
		// check for valid iteration plan
		boolean flagArray[] = new boolean[inf.getN()];
		for (HashSet<Integer> iteration : iterationPlan) {
			for (int element : iteration) {
				// if (!flagArray[element]) {
				flagArray[element] = true;
				// }
				// else {
				// System.out
				// .println("ERROR invalid iteration plan : duplicated element "
				// + element);
				// System.exit(1);
				// }
			}
		}
		ArrayList<Integer> missingSet = new ArrayList<Integer>();
		for (int i = 0; i < flagArray.length; i++) {
			if (!flagArray[i]) {
				missingSet.add(i);
			}
		}
		if (!missingSet.isEmpty()) {
			System.out
					.println("ERROR invalid iteration plan : missing element(s) "
							+ missingSet.toString());
			System.exit(1);
		}
		// check for valid processing power
		if (processingPower <= 0) {
			System.out
					.println("ERROR processing power should be positive, given "
							+ processingPower);
			System.exit(1);
		}
		// check for valid constraint
		if (constraint <= 0) {
			System.out
					.println("ERROR constraint value should be positive, given "
							+ constraint);
			System.exit(1);
		}
		if (constraint > 1) {
			System.out
					.println("ERROR constraint value should be less than 1, given "
							+ constraint);
			System.exit(1);
		}
		// assign private fields
		this.myType = type;
		this.myTotalNum = totalNum;
		this.myNum = 0;

		this.myInf = inf;
		this.myIterationPlan = iterationPlan;
		this.myProcessingPower = processingPower;
		// set initial location id randomly
		this.myLocId = -1;
		this.myCurrentIterationNum = 0;
		this.myImplementedElements = new HashSet<Integer>();
		this.myUnimplementedElements = new HashSet<Integer>();
		for (int i = 0; i < myInf.getN(); i++) {
			this.myUnimplementedElements.add(i);
		}
		this.myContraint = constraint;
		this.myIsAveraging = isAveraging;
		this.myIsExhaustive = isExhaustive;
		// this.myIsRefactoringAll = isRefactoringAll;
	}