本文整理了Java中net.automatalib.words.Alphabet.size()
方法的一些代码示例,展示了Alphabet.size()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Alphabet.size()
方法的具体详情如下:
包路径:net.automatalib.words.Alphabet
类名称:Alphabet
方法名:size
暂无
代码示例来源:origin: net.automatalib/automata-core
public AbstractCompactDeterministic(Alphabet<I> alphabet, int stateCapacity, float resizeFactor) {
this.alphabet = alphabet;
this.alphabetSize = alphabet.size();
this.transitions = new Object[stateCapacity * alphabetSize];
this.resizeFactor = resizeFactor;
this.stateCapacity = stateCapacity;
}
代码示例来源:origin: net.automatalib/automata-core
public AbstractCompactSimpleDet(Alphabet<I> alphabet, int stateCapacity, float resizeFactor) {
this.alphabet = alphabet;
this.alphabetSize = alphabet.size();
this.transitions = new int[stateCapacity * alphabetSize];
Arrays.fill(this.transitions, 0, this.transitions.length, INVALID_STATE);
this.resizeFactor = resizeFactor;
this.stateCapacity = stateCapacity;
}
代码示例来源: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-core
public <I2> CompactDFA<I2> translate(Alphabet<I2> newAlphabet) {
if (newAlphabet.size() != alphabetSize) {
throw new IllegalArgumentException(
"Alphabet sizes must match, but they do not (old/new): " + alphabetSize + " vs. " +
newAlphabet.size());
}
return new CompactDFA<>(newAlphabet, this);
}
代码示例来源:origin: de.learnlib/learnlib-nlstar
private void makeShort(Row<I> row) {
row.makeShort(upperRows.size(), alphabet.size());
upperRows.add(row);
newUppers.add(row);
}
代码示例来源:origin: net.automatalib/automata-core
@Override
protected FastMealyState<O> createState(Void property) {
return new FastMealyState<>(inputAlphabet.size());
}
}
代码示例来源: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: de.learnlib/learnlib-lstar-generic
protected Row<I> createSpRow(Word<I> prefix) {
Row<I> newRow = new Row<I>(prefix, numRows++, alphabet.size());
allRows.add(newRow);
rowMap.put(prefix, newRow);
shortPrefixRows.add(newRow);
return newRow;
}
代码示例来源:origin: LearnLib/automatalib
@Override
public Collection<I> getLocalInputs(Integer state) {
final Alphabet<I> alphabet = getInputAlphabet();
final List<I> result = new ArrayList<>(alphabet.size());
for (final I i : alphabet) {
if (getTransition(state, i) != null) {
result.add(i);
}
}
return result;
}
}
代码示例来源: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
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: net.automatalib/automata-serialization-saf
public <I, SP, TP> void writeAutomaton(UniversalAutomaton<?, I, ?, SP, TP> source,
Alphabet<I> alphabet,
AutomatonType expectedType,
BlockPropertyEncoder<? super SP> spEncoder,
SinglePropertyEncoder<? super TP> tpEncoder) throws IOException {
writeHeader(expectedType);
out.writeInt(alphabet.size());
writeAutomatonBody(source, alphabet, expectedType.isDeterministic(), spEncoder, tpEncoder);
}
代码示例来源:origin: net.automatalib/automata-util
public static <S, I> CompleteStateSignature build(UniversalDeterministicAutomaton<S, I, ?, ?, ?> automaton,
Alphabet<I> alphabet,
S state) {
int numInputs = alphabet.size();
Object[] properties = new Object[numInputs + 1];
fillTransitionProperties(automaton, alphabet, state, properties);
properties[numInputs] = automaton.getStateProperty(state);
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: 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: net.automatalib/automata-incremental
private Node<I, O> insertNode(Node<I, O> parent, int symIdx, O output) {
Node<I, O> succ = new Node<>(inputAlphabet.size());
Edge<I, O> edge = new Edge<>(output, succ);
parent.setEdge(symIdx, edge);
return succ;
}
代码示例来源:origin: de.learnlib.testsupport/learnlib-learning-examples
@Override
public String toString() {
return "Keylock[size=" + getReferenceAutomaton().size() + ",alphabetSize=" + getAlphabet().size() +
",cyclical=" + cyclical + "]";
}
代码示例来源:origin: net.automatalib/automata-core
@Override
public void addAlphabetSymbol(I symbol) {
if (this.inputAlphabet.containsSymbol(symbol)) {
return;
}
this.inputAlphabet = Alphabets.withNewSymbol(this.inputAlphabet, symbol);
final int newAlphabetSize = this.inputAlphabet.size();
for (final S s : this.getStates()) {
s.ensureInputCapacity(newAlphabetSize);
}
}
代码示例来源:origin: net.automatalib/automata-core
@Override
public void addAlphabetSymbol(I symbol) {
if (this.inputAlphabet.containsSymbol(symbol)) {
return;
}
this.inputAlphabet = Alphabets.withNewSymbol(this.inputAlphabet, symbol);
final int newAlphabetSize = this.inputAlphabet.size();
for (final S s : this.getStates()) {
s.ensureInputCapacity(newAlphabetSize);
}
}
代码示例来源:origin: de.learnlib/learnlib-discrimination-tree
@Override
public void addAlphabetSymbol(I symbol) {
if (this.alphabet.containsSymbol(symbol)) {
return;
}
this.alphabet = Alphabets.withNewSymbol(this.alphabet, symbol);
final int alphabetSize = this.alphabet.size();
for (final HState<I, O, SP, TP> s : this.getStates()) {
s.ensureInputCapacity(alphabetSize);
}
}
内容来源于网络,如有侵权,请联系作者删除!