// Path: happyresearch/src/main/java/happy/research/pgp/PGPNode.java
// public static enum SignerType
// {
// 	ExperiencedSigner, MediumSigner, NewbieSigner
// };


import happy.coding.math.Randoms;
import happy.research.pgp.PGPNode.SignerType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.math.FunctionEvaluationException;
import org.apache.commons.math.MaxIterationsExceededException;
import org.apache.commons.math.analysis.UnivariateRealFunction;
import org.apache.commons.math.analysis.integration.SimpsonIntegrator;
import org.apache.log4j.Logger;

			if (Arrays.binarySearch(honestIndexArray, i) >= 0)
				node.setHonestType(PGPNode.HonestType.Honest);
			else if (Arrays.binarySearch(neutralIndexArray, i) >= 0)
				node.setHonestType(PGPNode.HonestType.Neutral);
			else {
				node.setHonestType(PGPNode.HonestType.Dishonest);
			}

			if (Arrays.binarySearch(littleMistakeIndexArray, i) >= 0)
				node.setMistakeType(PGPNode.MistakeSingerType.Little);
			else if (Arrays.binarySearch(neutralMistakeIndexArray, i) >= 0)
				node.setMistakeType(PGPNode.MistakeSingerType.Neutral);
			else
				node.setMistakeType(PGPNode.MistakeSingerType.Many);
			nodes.add(node);
		}

		return nodes;
	}
	
	private static int[] xpSign(List<PGPNode> nodes, EnvironmentParams params) throws Exception
	{
		int numSigners = (int) (numNodes * params.ratExperiencedSigner + 0.5);
		int[] signerIndexArray = Randoms.nextIntArray(numSigners, numNodes, null);
		
		for (int i = 0; i < signerIndexArray.length; i++)
		{
			// signer
			int signerIndex = signerIndexArray[i];
			PGPNode signer = nodes.get(signerIndex);

// Path: happyresearch/src/main/java/happy/research/pgp/PGPNode.java
// public static enum SignerType
// {
// 	ExperiencedSigner, MediumSigner, NewbieSigner
// };


// Path: happyresearch/src/main/java/happy/research/pgp/AbstractPGP.java
import happy.coding.math.Randoms;
import happy.research.pgp.PGPNode.SignerType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.math.FunctionEvaluationException;
import org.apache.commons.math.MaxIterationsExceededException;
import org.apache.commons.math.analysis.UnivariateRealFunction;
import org.apache.commons.math.analysis.integration.SimpsonIntegrator;
import org.apache.log4j.Logger;

			if (Arrays.binarySearch(honestIndexArray, i) >= 0)
				node.setHonestType(PGPNode.HonestType.Honest);
			else if (Arrays.binarySearch(neutralIndexArray, i) >= 0)
				node.setHonestType(PGPNode.HonestType.Neutral);
			else {
				node.setHonestType(PGPNode.HonestType.Dishonest);
			}

			if (Arrays.binarySearch(littleMistakeIndexArray, i) >= 0)
				node.setMistakeType(PGPNode.MistakeSingerType.Little);
			else if (Arrays.binarySearch(neutralMistakeIndexArray, i) >= 0)
				node.setMistakeType(PGPNode.MistakeSingerType.Neutral);
			else
				node.setMistakeType(PGPNode.MistakeSingerType.Many);
			nodes.add(node);
		}

		return nodes;
	}
	
	private static int[] xpSign(List<PGPNode> nodes, EnvironmentParams params) throws Exception
	{
		int numSigners = (int) (numNodes * params.ratExperiencedSigner + 0.5);
		int[] signerIndexArray = Randoms.nextIntArray(numSigners, numNodes, null);
		
		for (int i = 0; i < signerIndexArray.length; i++)
		{
			// signer
			int signerIndex = signerIndexArray[i];
			PGPNode signer = nodes.get(signerIndex);

			signer.setSignerType(SignerType.ExperiencedSigner);
