InconsistencyStartingValueGenerator { public static double generate(InconsistencyParameter w, InconsistencyParameterization pmtz, StartingValueGenerator generator, Map<BasicParameter, Double> basicValues) { double x = 0.0; final List<Treatment> c = w.getCycle(); for (int i = 1; i < c.size(); ++i) { BasicParameter p = new BasicParameter(c.get(i - 1), c.get(i)); BasicParameter q = new BasicParameter(c.get(i), c.get(i - 1)); if (basicValues.containsKey(p)) { x += basicValues.get(p); } else if (basicValues.containsKey(q)) { x -= basicValues.get(q); } else { x += generator.getRelativeEffect(p); } } return x; }  static double generate(InconsistencyParameter w, InconsistencyParameterization pmtz,
			StartingValueGenerator generator, Map<BasicParameter, Double> basicValues);  }
@Test public void testGenerate() throws JAXBException { Network network = JAXBHandler.readNetwork(InconsistencyParameterization.class.getResourceAsStream("network.xml")); Treatment ta = new Treatment("A"); Treatment tb = new Treatment("B"); Treatment tc = new Treatment("C"); UndirectedGraph<Treatment, FoldedEdge<Treatment, Study>> cGraph = NetworkModel.createComparisonGraph(network); Tree<Treatment, FoldedEdge<Treatment, Study>> tree = new DelegateTree<Treatment, FoldedEdge<Treatment,Study>>(); tree.addVertex(ta); tree.addEdge(cGraph.findEdge(ta, tb), ta, tb); tree.addEdge(cGraph.findEdge(ta, tc), ta, tc); Map<Partition, Set<List<Treatment>>> cycleClasses = InconsistencyParameterization.getCycleClasses(cGraph, tree); Map<Study, Treatment> baselines = InconsistencyParameterization.findStudyBaselines(network.getStudies(), cGraph, cycleClasses); InconsistencyParameterization pmtz = new InconsistencyParameterization(network, tree, cycleClasses, baselines); StartingValueGenerator generator = new ContinuousDataStartingValueGenerator(network); Map<BasicParameter, Double> basicStart = new HashMap<BasicParameter, Double>(); final BasicParameter pab = new BasicParameter(ta, tb); basicStart.put(pab, generator.getRelativeEffect(pab)); final BasicParameter pac = new BasicParameter(ta, tc); basicStart.put(pac, generator.getRelativeEffect(pac)); InconsistencyParameter incons = (InconsistencyParameter) pmtz.getParameters().get(2); assertEquals(0.48, InconsistencyStartingValueGenerator.generate(incons, pmtz, generator, basicStart), EPSILON); }