本文整理汇总了Java中dk.brics.automaton.State.addTransition方法的典型用法代码示例。如果您正苦于以下问题:Java State.addTransition方法的具体用法?Java State.addTransition怎么用?Java State.addTransition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dk.brics.automaton.State
的用法示例。
在下文中一共展示了State.addTransition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dfaToDkAutomaton
import dk.brics.automaton.State; //导入方法依赖的package包/类
private static Automaton dfaToDkAutomaton(TIntObjectMap<State> map, Machine machine) {
dk.brics.automaton.Automaton dkAut = new dk.brics.automaton.Automaton();
APList aps = machine.getInAPs();
for(int stateNr = 0; stateNr < machine.getStateSize(); stateNr ++) {
State state = getState(map, stateNr);
// initial states
if(machine.getInitialState() == stateNr) {
dkAut.setInitialState(state);
}
// final states
if(machine.getAcceptance().isFinal(stateNr)) {
state.setAccept(true);
}
for (int letter = 0; letter < aps.size(); letter ++) {
int succ = machine.getSuccessor(stateNr, letter);
State stateSucc = getState(map, succ);
state.addTransition(new Transition(aps.get(letter).toString().charAt(0),
stateSucc));
}
}
dkAut.setDeterministic(true);
return dkAut;
}
示例2: getCheckAutomaton
import dk.brics.automaton.State; //导入方法依赖的package包/类
@Override
public VacuityAwareWildcardAutomaton getCheckAutomaton() {
VacuityAwareWildcardAutomaton autom = new VacuityAwareWildcardAutomaton(
this.getRegularExpression(), TaskCharEncoderDecoder.getTranslationMap(this.getInvolvedTaskChars()), this.toString());
// TODO Tweaking to insert the loopback to the initial state
State state = autom.getInitialState();
int i = 0;
for (; i < this.getParameters().size() - 1; i++) {
state = state.step(this.parameters.get(i).getFirstTaskChar().identifier);
}
State stateToRemove = state.step(this.parameters.get(i).getFirstTaskChar().identifier);
state.getTransitions().remove(new Transition(this.parameters.get(i).getFirstTaskChar().identifier, stateToRemove));
RelevanceAwareTransition newTransition = new RelevanceAwareTransition(this.parameters.get(i).getFirstTaskChar().identifier, autom.getInitialState(), this.parameters.get(i).getFirstTaskChar().taskClass.toString());
newTransition.setRelevance(TransitionRelevance.RELEVANT);
state.addTransition(newTransition);
return autom;
}
示例3: pruneOutRedundantTransitions
import dk.brics.automaton.State; //导入方法依赖的package包/类
private void pruneOutRedundantTransitions(State initialState) {
boolean redundantTransitions = false;
State nextState = initialState.step(basingCharacter.charValue());
// Heuristic 1: if the automaton contains an action with the basingCharacter, the other are optional: we can exclude them!
if (nextState != null)
redundantTransitions = true;
if (redundantTransitions) {
Iterator<Transition> transIterator = initialState.getTransitions().iterator();
while (transIterator.hasNext()) {
transIterator.next();
transIterator.remove();
}
initialState.addTransition(new Transition(basingCharacter, nextState));
}
else {
Set<Transition> transitions = initialState.getTransitions();
if (transitions.size() == 0) {
return;
} else {
for (Transition transition : transitions) {
this.pruneOutRedundantTransitions(transition.getDest());
}
}
}
}
开发者ID:cdc08x,项目名称:MINERful,代码行数:27,代码来源:DimensionalityHeuristicBasedCallableBriefSubAutomataMaker.java