當前位置: 首頁>>代碼示例>>Java>>正文


Java IntChoiceGenerator類代碼示例

本文整理匯總了Java中gov.nasa.jpf.vm.IntChoiceGenerator的典型用法代碼示例。如果您正苦於以下問題:Java IntChoiceGenerator類的具體用法?Java IntChoiceGenerator怎麽用?Java IntChoiceGenerator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IntChoiceGenerator類屬於gov.nasa.jpf.vm包,在下文中一共展示了IntChoiceGenerator類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: RandomOrderIntCG

import gov.nasa.jpf.vm.IntChoiceGenerator; //導入依賴的package包/類
public RandomOrderIntCG(IntChoiceGenerator sub) {
  super(sub.getId());
  setPreviousChoiceGenerator(sub.getPreviousChoiceGenerator());
  choices = new int[sub.getTotalNumberOfChoices()];
  for (int i = 0; i < choices.length; i++) {
    sub.advance();
    choices[i] = sub.getNextChoice();
  }
  for (int i = choices.length - 1; i > 0; i--) { // all but first
    int j = random.nextInt(i + 1);
    int tmp = choices[i];
    choices[i] = choices[j];
    choices[j] = tmp;
  }
  nextIdx = -1;
}
 
開發者ID:grzesuav,項目名稱:gjpf-core,代碼行數:17,代碼來源:RandomOrderIntCG.java

示例2: getValue

import gov.nasa.jpf.vm.IntChoiceGenerator; //導入依賴的package包/類
@Override
public Object getValue(ChoiceGenerator generator) {
     if (generator instanceof ThreadChoiceGenerator) {
       return (getType((ThreadChoiceGenerator) generator));
     }

     if (generator instanceof BooleanChoiceGenerator) {
       return (CGType.DataChoice);
     }

     if (generator instanceof DoubleChoiceGenerator) {
       return (CGType.DataChoice);
     }

     if (generator instanceof IntChoiceGenerator) {
       return (CGType.DataChoice);
     }

     if (generator instanceof BooleanChoiceGenerator) {
       return (CGType.DataChoice);
     }

     return (null);
   }
 
開發者ID:grzesuav,項目名稱:gjpf-core,代碼行數:25,代碼來源:StateSpaceAnalyzer.java

示例3: choiceGeneratorAdvanced

import gov.nasa.jpf.vm.IntChoiceGenerator; //導入依賴的package包/類
@Override
public void choiceGeneratorAdvanced (VM vm, ChoiceGenerator<?> currentCG){
  if (currentCG instanceof IntIntervalGenerator){
    int v = ((IntChoiceGenerator)currentCG).getNextChoice();
    if (v >= lastVal){
      fail("values not decreasing");
    }
    lastVal = v;
  }
}
 
開發者ID:grzesuav,項目名稱:gjpf-core,代碼行數:11,代碼來源:CGReorderTest.java

示例4: getLastChoice

import gov.nasa.jpf.vm.IntChoiceGenerator; //導入依賴的package包/類
protected String getLastChoice() {
  ChoiceGenerator<?> cg = vm.getChoiceGenerator();
  Object choice = cg.getNextChoice();

  Instruction insn = cg.getInsn();

  if (cg instanceof BreakGenerator){
    return "break";
  } else if (choice instanceof ThreadInfo){
    int idx = ((ThreadInfo)choice).getId();
    return "T"+idx;
  } else if (IndexSelector.isIndexChoice(cg)) {
    return "idx: " + choice;
  } else if (ElementSelector.isElementChoice(cg)) {
    return "elem: " + choice;
  } else if (insn instanceof AbstractBranching) {
    Predicate p = ((AbstractBranching)insn).getLastPredicate();

    if (cg instanceof IntChoiceGenerator) {
        if ((Integer) cg.getNextChoice() == 0) {
            return Negation.create(p).toString(Notation.DOT_NOTATION);
        } else {
            return p.toString(Notation.DOT_NOTATION);
        }
    }
  } else if (insn instanceof ArrayStoreInstruction || insn instanceof ArrayLoadInstruction) {
      if (cg instanceof AbstractChoiceGenerator) {
          if ((Integer) cg.getNextChoice() == 0) {
              return "outOfBounds";
          } else {
              return "inBounds";
          }
      }
  }

  return choice.toString(); // we probably want more here
}
 
開發者ID:d3sformal,項目名稱:panda,代碼行數:38,代碼來源:SimpleDot.java

示例5: randomize

import gov.nasa.jpf.vm.IntChoiceGenerator; //導入依賴的package包/類
public IntChoiceGenerator randomize() {
    return new AbstractChoiceGenerator(random.nextBoolean());
}
 
開發者ID:d3sformal,項目名稱:panda,代碼行數:4,代碼來源:AbstractChoiceGenerator.java


注:本文中的gov.nasa.jpf.vm.IntChoiceGenerator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。