本文整理汇总了Java中net.automatalib.words.Alphabet类的典型用法代码示例。如果您正苦于以下问题:Java Alphabet类的具体用法?Java Alphabet怎么用?Java Alphabet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Alphabet类属于net.automatalib.words包,在下文中一共展示了Alphabet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readTransitionsFrom
import net.automatalib.words.Alphabet; //导入依赖的package包/类
private static List<CompactMealyTransitionProxy> readTransitionsFrom(MealyMachine machine,
Map<Object, Integer> statesIndex,
Alphabet<String> sigma) {
List<CompactMealyTransitionProxy> newTransitions = new LinkedList<>();
for (Object state : machine) {
Integer v = statesIndex.get(state);
for (String input : sigma) {
Integer w = statesIndex.get(machine.getSuccessor(state, input));
if (w != null) {
String output = machine.getOutput(state, input).toString();
CompactMealyTransitionProxy newTransition = new CompactMealyTransitionProxy(v, input, w, output);
newTransitions.add(newTransition);
}
}
}
return newTransitions;
}
示例2: shouldGetOneTestResult
import net.automatalib.words.Alphabet; //导入依赖的package包/类
@Test
public void shouldGetOneTestResult() throws NotFoundException, JsonProcessingException {
// given
ObjectMapper objectMapper = new ObjectMapper();
Alphabet<String> sigma = new SimpleAlphabet<>();
sigma.add("0");
sigma.add("1");
LearnerResult learnerResult = new LearnerResult();
learnerResult.setProject(project);
learnerResult.setTestNo(RESULT_ID);
learnerResult.setSigma(AlphabetProxy.createFrom(sigma));
given(learnerResultDAO.get(admin, PROJECT_ID, RESULT_ID, false)).willReturn(learnerResult);
// when
Response response = target("/projects/" + PROJECT_ID + "/results/" + RESULT_ID).request()
.header("Authorization", adminToken).get();
// then
assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
assertEquals(objectMapper.writeValueAsString(learnerResult), response.readEntity(String.class));
}
示例3: RandomCoverageSelectionEQOracle
import net.automatalib.words.Alphabet; //导入依赖的package包/类
public RandomCoverageSelectionEQOracle(TestTrackingSUL sul, Alphabet<Symbol> alphabet,
List<MutationOperator> mutationOperators, int sizeTestSelectionSuite, boolean reuseRemaining,
TestSelector<T> selector, TraceGenerator traceGen, MutantSamplingStrategy mutantSampler) {
super();
this.sul = sul;
this.mutationOperators = mutationOperators;
this.alphabet = alphabet;
this.sizeTestSelectionSuite = sizeTestSelectionSuite;
this.reuseRemaining = reuseRemaining;
this.selector = selector;
this.traceGen = traceGen;
this.mutantSampler = mutantSampler;
}
示例4: MuDirectedIterativeGenerator
import net.automatalib.words.Alphabet; //导入依赖的package包/类
public MuDirectedIterativeGenerator(double stopProb, double retryProb,
Alphabet<Symbol> inputAlphabet, int maxTestLength, int maxRandWordLen) {
super();
this.stopProb = stopProb;
this.retryProb = retryProb;
this.equivChecker = new EquivalenceChecker(inputAlphabet,true);
this.maxTestLength = maxTestLength;
this.randomWordGen = new RandomWordGenerator(inputAlphabet, randGen, maxRandWordLen);
this.randomWordGenMaxLen = new RandomWordGenerator(inputAlphabet, randGen, maxTestLength);
}
示例5: AdaptedLeeYannakakisGenerator
import net.automatalib.words.Alphabet; //导入依赖的package包/类
public AdaptedLeeYannakakisGenerator(String generatorPath, String prefixStrategy, int expectedRandInfix,
Alphabet<Symbol> inputAlphabet){
this.generatorPath = generatorPath;
pb = new ProcessBuilder(generatorPath, "--prefix",
prefixStrategy, "--seed", Integer.toString(seed) ,
"=",
"random", "0", Integer.toString(expectedRandInfix));
this.prefixStrategy = prefixStrategy;
this.expectedRandInfix = expectedRandInfix;
this.inputAlphabet = inputAlphabet;
}
示例6: RandomWpTraceGenerator
import net.automatalib.words.Alphabet; //导入依赖的package包/类
public RandomWpTraceGenerator(int minimalSize, int rndLength, Alphabet<Symbol> inputAlphabet,
Random rand) {
this.minimalSize = minimalSize;
this.rndLength = rndLength;
this.inputAlphabet = inputAlphabet;
this.rand = rand;
}
示例7: MuDirectedRandomWordGenerator
import net.automatalib.words.Alphabet; //导入依赖的package包/类
public MuDirectedRandomWordGenerator(int maxRandPreLen, int maxRandSufLen, Random randGen,
Alphabet<Symbol> inputAlphabet) {
super();
this.randGen = randGen;
randPrefGen = new RandomWordGenerator(inputAlphabet, randGen, maxRandPreLen);
randSufGen = new RandomWordGenerator(inputAlphabet, randGen, maxRandSufLen);
this.equivChecker = new EquivalenceChecker(inputAlphabet,true);
}
示例8: getOutputAlphabet
import net.automatalib.words.Alphabet; //导入依赖的package包/类
protected Alphabet<String> getOutputAlphabet(FastMealy<Symbol,String> hypothesis) {
Collection<FastMealyState<String>> allStates = hypothesis.getStates();
Stream<String> outputStream = inputAlphabet.stream().
flatMap(i -> allStates.stream().map(s -> hypothesis.getOutput(s, i))).distinct();
SimpleAlphabet<String> outputAlphabet = new SimpleAlphabet<>();
outputStream.forEach(o -> outputAlphabet.add(o));
return outputAlphabet;
}
示例9: createEqOracle
import net.automatalib.words.Alphabet; //导入依赖的package包/类
@Override
public EquivalenceOracle<MealyMachine<?, String, ?, String>, String, Word<String>> createEqOracle(
MembershipOracle<String, Word<String>> membershipOracle, int batchSize) {
Alphabet<String> alphabet = hypothesis.createAlphabet();
CompactMealy<String, String> compactMealy = hypothesis.createMealyMachine(alphabet);
return new SimulatorEQOracle.MealySimulatorEQOracle<>(compactMealy);
}
示例10: createFrom
import net.automatalib.words.Alphabet; //导入依赖的package包/类
/**
* Create a proxy around a specific MealyMachine.
*
* @param machine
* The MealyMachine the Proxy should wrap in
* @param sigma
* The Alphabet of the MealyMachine.
* @return A new Proxy around the given MealyMachine.
*/
public static CompactMealyMachineProxy createFrom(MealyMachine<?, String, ?, String> machine,
Alphabet<String> sigma) {
CompactMealyMachineProxy newProxy = new CompactMealyMachineProxy();
Map<Object, Integer> statesIndex = createStatesIndex(machine);
List newStates = readStatesFrom(statesIndex);
newProxy.setNodes(newStates);
newProxy.initNode = statesIndex.get(machine.getInitialState());
List newTransitions = readTransitionsFrom(machine, statesIndex, sigma);
newProxy.setEdges(newTransitions);
return newProxy;
}
示例11: createAlphabet
import net.automatalib.words.Alphabet; //导入依赖的package包/类
/**
* Create an Alphabet based on the proxy.
*
* @return An Alphabet with all the proxy input symbols.
*/
@Transient
@JsonIgnore
public Alphabet<String> createAlphabet() {
Set<String> inputs = edges.stream().map(CompactMealyTransitionProxy::getInput)
.collect(Collectors.toSet());
Alphabet<String> alphabet = new SimpleAlphabet<>(inputs);
return alphabet;
}
示例12: createLearner
import net.automatalib.words.Alphabet; //导入依赖的package包/类
@Override
public LearningAlgorithm.MealyLearner<String, String> createLearner(
Alphabet<String> alphabet, MembershipOracle<String, Word<String>> membershipOracle) {
return new KearnsVaziraniMealyBuilder<String, String>()
.withAlphabet(alphabet)
.withOracle(membershipOracle)
.create();
}
示例13: shouldCreateCorrectLearner
import net.automatalib.words.Alphabet; //导入依赖的package包/类
@Test
public void shouldCreateCorrectLearner() {
Alphabet<String> sigma = new SimpleAlphabet<>();
sigma.add("a");
sigma.add("b");
SULOracle<String, String> oracle = mock(SULOracle.class);
algorithm.createLearner(sigma, oracle);
}
示例14: createTestLearnResults
import net.automatalib.words.Alphabet; //导入依赖的package包/类
private List<LearnerResult> createTestLearnResults() {
List<LearnerResult> results = new LinkedList<>();
for (long i = 0; i < TEST_RESULT_AMOUNT; i++) {
Alphabet<String> sigma = new SimpleAlphabet<>();
sigma.add("0");
sigma.add("1");
LearnerResult learnerResult = new LearnerResult();
learnerResult.setProject(project);
learnerResult.setTestNo(i);
learnerResult.setSigma(AlphabetProxy.createFrom(sigma));
results.add(learnerResult);
} return results;
}
示例15: getAlphabet
import net.automatalib.words.Alphabet; //导入依赖的package包/类
@Override
public Alphabet<Symbol> getAlphabet() {
return alphabet;
}