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


Java Transition.getDest方法代码示例

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


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

示例1: visitTransitions

import dk.brics.automaton.Transition; //导入方法依赖的package包/类
public void visitTransitions(NavigableMap<State, ActivationStatusAwareState> statesTranslationMap, NavigableSet<State> visitedStates, State currentState) {
	if (visitedStates.contains(currentState))
		return;

	ActivationStatusAwareState
		currentStAwaState = statesTranslationMap.get(currentState),
		destStAwaState = null;
	State destinationState = null;

	this.decideActivationStatus(currentState, currentStAwaState);

	for (Transition trans : currentState.getTransitions()) {
		destinationState = trans.getDest();
		
		if (!statesTranslationMap.containsKey(destinationState)) {
			destStAwaState = makeNewState();
			statesTranslationMap.put(destinationState, destStAwaState);
		} else {
			destStAwaState = statesTranslationMap.get(destinationState);
		}
		for (char evt = trans.getMin(); evt <= trans.getMax(); evt++) {
			currentStAwaState.addTransition(new RelevanceAwareTransition(evt, destStAwaState,
					translationMap.get(evt).toString()));
			this.alphabet.add(evt);
		}

		visitedStates.add(currentState);

		// Recursive call: after this call, the reachable states have all been visited and assigned an activation status  
		visitTransitions(statesTranslationMap, visitedStates, destinationState);
	}

	this.decideRelevanceOfTransitions(currentStAwaState);

	return;
}
 
开发者ID:cdc08x,项目名称:MINERful,代码行数:37,代码来源:VacuityAwareAutomaton.java

示例2: unfoldTransitions

import dk.brics.automaton.Transition; //导入方法依赖的package包/类
public void unfoldTransitions(
		NavigableMap<State, WeightedState> statesTranslationMap, NavigableSet<State> visitedStates, State currentState) {
	if (visitedStates.contains(currentState))
		return;

	WeightedState currentWState = statesTranslationMap.get(currentState), destinationWState = null;
	State destinationState = null;

	if (currentState.isAccept())
		currentWState.setAccept(true);

	for (Transition trans : currentState.getTransitions()) {
		destinationState = trans.getDest();
		if (!statesTranslationMap.containsKey(destinationState)) {
			destinationWState = new WeightedState();
			statesTranslationMap.put(destinationState, destinationWState);
		} else {
			destinationWState = statesTranslationMap.get(destinationState);
		}
		for (char evt = trans.getMin(); evt <= trans.getMax(); evt++) {
			currentWState.addTransition(new WeightedTransition(evt,
					destinationWState, translationMap.get(evt).toString()));
		}

		visitedStates.add(currentState);
		unfoldTransitions(statesTranslationMap, visitedStates,
				destinationState);
	}
}
 
开发者ID:cdc08x,项目名称:MINERful,代码行数:30,代码来源:WeightedAutomaton.java

示例3: closeScope

import dk.brics.automaton.Transition; //导入方法依赖的package包/类
private Automaton closeScope(Automaton automaton) {
	// Make sure automaton is deterministic
	automaton.determinize();
	
	// Skip the starting character, as it is not part of the actual sequence
	State oldInit = automaton.getInitialState();
	State realInit = oldInit.step(startChar);
	
	// Duplicate the initial state, as it will *not* receive any epsilon-transitions
	// for the inner character
	State newInit = new State();
	newInit.setAccept(true);
	newInit.getTransitions().addAll(realInit.getTransitions());
	
	automaton.setInitialState(newInit);
	

	automaton.setDeterministic(false);
	
	for(State s : automaton.getStates()) {
		s.setAccept(true);
		if(s.step(endChar) != null) {
			s.getTransitions().clear();
			continue;
		}
		
		if(s != newInit) {
			State innerSucc = s.step(innerChar);
			if(innerSucc != null) {
				automaton.addEpsilons(Collections.singleton(new StatePair(s, innerSucc)));
			}
		}
		
		// Remove all transitions with special characters
		List<Transition> newTransitions = new ArrayList<>();
		Set<Transition> transSet = s.getTransitions();
		Iterator<Transition> transIt = transSet.iterator();
		
		while(transIt.hasNext()) {
			Transition t = transIt.next();
			State succ = t.getDest();
			
			if(t.getMax() > overallHigh) {
				transIt.remove();
				if(t.getMin() <= overallHigh) {
					newTransitions.add(new Transition(t.getMin(), overallHigh, succ));
				}
			}
		}
		
		transSet.addAll(newTransitions);
	}
	
	automaton.determinize();
	automaton.minimize();
	
	return automaton;
}
 
开发者ID:misberner,项目名称:duzzt,代码行数:59,代码来源:BricsCompiler.java


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