本文整理了Java中net.automatalib.words.Alphabet.getSymbol()
方法的一些代码示例,展示了Alphabet.getSymbol()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Alphabet.getSymbol()
方法的具体详情如下:
包路径:net.automatalib.words.Alphabet
类名称:Alphabet
方法名:getSymbol
[英]Returns the symbol with the given index in this alphabet.
[中]返回此字母表中具有给定索引的符号。
代码示例来源:origin: net.automatalib/automata-api
@Override
default void writeToArray(int offset, Object[] array, int tgtOfs, int num) {
for (int i = offset, j = tgtOfs, k = 0; k < num; i++, j++, k++) {
array[j] = getSymbol(i);
}
}
代码示例来源:origin: net.automatalib/automata-api
default <I2> Mapping<I2, I> translateFrom(Alphabet<I2> other) {
if (other.size() > size()) {
throw new IllegalArgumentException(
"Cannot translate from an alphabet with " + other.size() + " elements into an alphabet with only " +
size() + " elements");
}
return i -> getSymbol(other.getSymbolIndex(i));
}
代码示例来源:origin: net.automatalib/automata-api
@Override
default I apply(int index) {
return getSymbol(index);
}
代码示例来源:origin: LearnLib/automatalib
default <I2> Mapping<I2, I> translateFrom(Alphabet<I2> other) {
if (other.size() > size()) {
throw new IllegalArgumentException(
"Cannot translate from an alphabet with " + other.size() + " elements into an alphabet with only " +
size() + " elements");
}
return i -> getSymbol(other.getSymbolIndex(i));
}
代码示例来源:origin: LearnLib/automatalib
@Override
default void writeToArray(int offset, Object[] array, int tgtOfs, int num) {
for (int i = offset, j = tgtOfs, k = 0; k < num; i++, j++, k++) {
array[j] = getSymbol(i);
}
}
代码示例来源:origin: LearnLib/automatalib
@Override
default I apply(int index) {
return getSymbol(index);
}
代码示例来源:origin: net.automatalib/automata-api
@Override
public Word<Object> canonicalNext(Alphabet<Object> sigma) {
return new LetterWord<>(sigma.getSymbol(0));
}
代码示例来源:origin: LearnLib/automatalib
@Override
public Word<Object> canonicalNext(Alphabet<Object> sigma) {
return new LetterWord<>(sigma.getSymbol(0));
}
代码示例来源:origin: de.learnlib/learnlib-lstar
@Override
protected List<Word<I>> initialSuffixes() {
List<Word<I>> suffixes = new ArrayList<>(alphabet.size());
for (int i = 0; i < alphabet.size(); i++) {
I sym = alphabet.getSymbol(i);
suffixes.add(Word.fromLetter(sym));
}
return suffixes;
}
代码示例来源:origin: de.learnlib/learnlib-dhc
private void scheduleSuccessors(QueueElement<I, O> elem,
Integer state,
Queue<QueueElement<I, O>> queue,
List<Word<O>> sig) throws IllegalArgumentException {
for (int i = 0; i < alphabet.size(); ++i) {
// retrieve I/O for transition
I input = alphabet.getSymbol(i);
O output = sig.get(i).getSymbol(0);
// create successor element and schedule for exploration
queue.add(new QueueElement<>(state, elem, input, output));
}
}
代码示例来源:origin: de.learnlib/learnlib-lstar-generic
@Override
protected List<Word<I>> initialSuffixes() {
List<Word<I>> suffixes = new ArrayList<Word<I>>(alphabet.size());
for(int i = 0; i < alphabet.size(); i++) {
I sym = alphabet.getSymbol(i);
suffixes.add(Word.fromLetter(sym));
}
return suffixes;
}
代码示例来源:origin: net.automatalib/automata-util
private static <S, I> void fillTransitionProperties(UniversalDeterministicAutomaton<S, I, ?, ?, ?> automaton,
Alphabet<I> alphabet,
S state,
Object[] properties) {
int numInputs = alphabet.size();
for (int i = 0; i < numInputs; i++) {
I sym = alphabet.getSymbol(i);
properties[i] = automaton.getTransitionProperty(state, sym);
}
}
代码示例来源:origin: LearnLib/automatalib
@Override
public Collection<I> getLocalInputs(S state) {
final Alphabet<I> alphabet = getInputAlphabet();
final int alphabetSize = alphabet.size();
final List<I> result = new ArrayList<>(alphabetSize);
for (int i = 0; i < alphabetSize; i++) {
final Collection<T> trans = state.getTransitionObject(i);
if (trans != null && !trans.isEmpty()) {
result.add(alphabet.getSymbol(i));
}
}
return result;
}
}
代码示例来源:origin: LearnLib/automatalib
private static <S, I> void fillTransitionProperties(UniversalDeterministicAutomaton<S, I, ?, ?, ?> automaton,
Alphabet<I> alphabet,
S state,
Object[] properties) {
int numInputs = alphabet.size();
for (int i = 0; i < numInputs; i++) {
I sym = alphabet.getSymbol(i);
properties[i] = automaton.getTransitionProperty(state, sym);
}
}
代码示例来源:origin: LearnLib/automatalib
@Override
public Collection<I> getLocalInputs(S state) {
final Alphabet<I> alphabet = getInputAlphabet();
final int alphabetSize = alphabet.size();
final List<I> result = new ArrayList<>(alphabetSize);
for (int i = 0; i < alphabetSize; i++) {
if (state.getTransitionObject(i) != null) {
result.add(alphabet.getSymbol(i));
}
}
return result;
}
}
代码示例来源:origin: net.automatalib/automata-util
public static <S, I> CompleteStateSignature buildFromTransitions(UniversalDeterministicAutomaton<S, I, ?, ?, ?> automaton,
Alphabet<I> alphabet,
S state) {
int numInputs = alphabet.size();
Object[] properties = new Object[numInputs];
for (int i = 0; i < numInputs; i++) {
I sym = alphabet.getSymbol(i);
properties[i] = automaton.getTransitionProperty(state, sym);
}
return new CompleteStateSignature(properties);
}
代码示例来源:origin: LearnLib/automatalib
public static <S, I> CompleteStateSignature buildFromTransitions(UniversalDeterministicAutomaton<S, I, ?, ?, ?> automaton,
Alphabet<I> alphabet,
S state) {
int numInputs = alphabet.size();
Object[] properties = new Object[numInputs];
for (int i = 0; i < numInputs; i++) {
I sym = alphabet.getSymbol(i);
properties[i] = automaton.getTransitionProperty(state, sym);
}
return new CompleteStateSignature(properties);
}
代码示例来源:origin: de.learnlib/learnlib-discrimination-tree
protected void initializeState(HState<I, D, SP, TP> newState) {
newStates.add(newState);
int size = alphabet.size();
for (int i = 0; i < size; i++) {
I sym = alphabet.getSymbol(i);
HTransition<I, D, SP, TP> newTrans = new HTransition<>(newState, sym, dtree.getRoot());
newState.setTransition(i, newTrans);
newTransitions.add(newTrans);
openTransitions.offer(newTrans);
}
}
代码示例来源:origin: de.learnlib/learnlib-nlstar
private List<List<Row<I>>> fixInconsistency(Inconsistency<I> incons) {
I sym = alphabet.getSymbol(incons.getSymbolIdx());
Word<I> oldSuffix = table.getSuffix(incons.getSuffixIdx());
Word<I> newSuffix = oldSuffix.prepend(sym);
return table.addSuffix(newSuffix);
}
代码示例来源:origin: de.learnlib/learnlib-ttt
/**
* Initializes a state. Creates its outgoing transition objects, and adds them to the "open" list.
*
* @param state
* the state to initialize
*/
protected void initializeState(TTTState<I, D> state) {
for (int i = 0; i < alphabet.size(); i++) {
I sym = alphabet.getSymbol(i);
TTTTransition<I, D> trans = createTransition(state, sym);
trans.setNonTreeTarget(dtree.getRoot());
state.setTransition(i, trans);
openTransitions.insertIncoming(trans);
}
}
内容来源于网络,如有侵权,请联系作者删除!