当前位置: 首页>>代码示例>>Java>>正文


Java Search.getTransition方法代码示例

本文整理汇总了Java中gov.nasa.jpf.search.Search.getTransition方法的典型用法代码示例。如果您正苦于以下问题:Java Search.getTransition方法的具体用法?Java Search.getTransition怎么用?Java Search.getTransition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.nasa.jpf.search.Search的用法示例。


在下文中一共展示了Search.getTransition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeGdfLabel

import gov.nasa.jpf.search.Search; //导入方法依赖的package包/类
/**
 * Return the string that will be used to label this state in the GDF graph.
 */
private String makeGdfLabel(Search state, int my_id) {
  Transition trans = state.getTransition();
  if (trans == null) {
	  return "-init-";
	}

	StringBuilder result = new StringBuilder();

	if (transition_numbers) {
	  result.append(my_id);
	  result.append(':');
	}

	Step last_trans_step = trans.getLastStep();
	result.append(last_trans_step.toString());

	if (show_source) {
	  String source_line=last_trans_step.getLineString();
	  if ((source_line != null) && !source_line.equals("")) {

	    // We need to deal with gdf-specific special characters which couls appear
	    // in the Java source line, such as '"'.
	    result.append(source_line);
	  	convertGdfSpecial(result);
	  }
  }
	return result.toString();
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:32,代码来源:StateSpaceDot.java

示例2: addEdge

import gov.nasa.jpf.search.Search; //导入方法依赖的package包/类
/**
 * Create an edge in the graph file from old_id to new_id.
 */
private void addEdge(int old_id, int new_id, Search state) throws IOException {
  int my_id = edge_id++;
  if (format==GDF_FORMAT) {
    Transition trans=state.getTransition();
    int thread = trans.getThreadIndex();

    // edgedef>node1,node2,label,labelvisible,directed,thread INT

    // Old State -> Transition - labeled with the source info if any.
    gdfEdges.add(
    		makeGdfEdgeString("st"+old_id, "tr"+my_id,
    				          makeGdfLabel(state, my_id),
    				          thread));

    // Transition node: name,label,style,color
    graph.write("tr" + my_id + ",\"" +my_id+"\","+transition_node_style);

    graph.newLine();
    // Transition -> New State - labeled with the last output if any.

    String lastOutputLabel=
    	replaceString(convertGdfSpecial(trans.getOutput()), "\"", "\'\'");
    gdfEdges.add(
    	makeGdfEdgeString("tr"+my_id, "st"+new_id, lastOutputLabel, thread));
  } else { // DOT
    graph.write("  st" + old_id + " -> tr" + my_id + ";");
    graph.newLine();
    graph.write("  tr" + my_id + " [label=\"" + makeDotLabel(state, my_id) +
                "\",shape=box]");
    graph.newLine();
    graph.write("  tr" + my_id + " -> st" + new_id + ";");
  }
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:37,代码来源:StateSpaceDot.java

示例3: makeDotLabel

import gov.nasa.jpf.search.Search; //导入方法依赖的package包/类
/**
 * Return the string that will be used to label this state for the user.
 */
private String makeDotLabel(Search state, int my_id) {
  Transition trans = state.getTransition();
  if (trans == null) {
    return "-init-";
  }
  Step last_trans_step = trans.getLastStep();
  if (last_trans_step == null) {
    return "?";
  }

  StringBuilder result = new StringBuilder();

  if (transition_numbers) {
    result.append(my_id);
    result.append("\\n");
  }

  int thread = trans.getThreadIndex();

  result.append("Thd");
  result.append(thread);
  result.append(':');
  result.append(last_trans_step.toString());

  if (show_source) {
    String source_line=last_trans_step.getLineString();
    if ((source_line != null) && !source_line.equals("")) {
      result.append("\\n");

      StringBuilder sb=new StringBuilder(source_line);

      // We need to precede the dot-specific special characters which appear
      // in the Java source line, such as ']' and '"', with the '\' escape
      // characters and also to remove any new lines.

      replaceString(sb, "\n", "");
      replaceString(sb, "]", "\\]");
      replaceString(sb, "\"", "\\\"");
      result.append(sb.toString());
    }
  }

  return result.toString();
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:48,代码来源:StateSpaceDot.java


注:本文中的gov.nasa.jpf.search.Search.getTransition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。