1 package gov.nasa.jpf.search.heuristic; 20 21 import gov.nasa.jpf.Config; 22 import gov.nasa.jpf.util.CoverageManager; 23 24 25 28 public class PersistGlobalBranchCoverage implements Heuristic { 29 private int old = 1; 30 HeuristicSearch search; 31 32 public PersistGlobalBranchCoverage (Config config, HeuristicSearch search) { 33 this.search = search; 34 search.setCalcBranchCoverage(true); 35 } 36 37 public int heuristicValue () { 38 int li = CoverageManager.getLastIncrementedGlobal(); 39 40 if (li >= 0) { 41 return li; 42 } else { 43 return old; 44 } 45 } 46 47 public void processParent () { 48 old = search.getOld().getPriority(); 49 } 50 } | Popular Tags |