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


Java SUL类代码示例

本文整理汇总了Java中de.learnlib.api.SUL的典型用法代码示例。如果您正苦于以下问题:Java SUL类的具体用法?Java SUL怎么用?Java SUL使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: loadEquivalenceAlgorithm

import de.learnlib.api.SUL; //导入依赖的package包/类
public void loadEquivalenceAlgorithm(String algorithm, SimpleAlphabet<String> alphabet, SUL<String, String> sul) throws Exception {
	//TODO We could combine the two cached oracle to save some queries to the SUL
	// Create the equivalence oracle
	//eqOracle = new SULOracle<String, String>(sul);
	// Add a logging oracle
	logEqOracle = new MealyLogOracle<String, String>(sul, LearnLogger.getLogger("equivalence_queries"));
	// Add an oracle that counts the number of queries
	statsEqOracle = new MealyCounterOracle<String, String>(logEqOracle, "equivalence queries to SUL");
	// Use cache oracle to prevent double queries to the SUL
	//cachedEqOracle = MealyCacheOracle.createDAGCacheOracle(alphabet, statsEqOracle);
       // Count the number of queries to the cache
	statsCachedEqOracle = new MealyCounterOracle<String, String>(statsEqOracle, "equivalence queries to cache");
	
	// Instantiate the selected equivalence algorithm
	switch(algorithm.toLowerCase()) {
		case "wmethod":
			equivalenceAlgorithm = new WMethodEQOracle.MealyWMethodEQOracle<String, String>(config.max_depth, statsCachedEqOracle);
			break;

		case "modifiedwmethod":
			equivalenceAlgorithm = new MealyModifiedWMethodEQOracle<String, String>(config.max_depth, statsCachedEqOracle);
			break;
			
		case "wpmethod":
			equivalenceAlgorithm = new WpMethodEQOracle.MealyWpMethodEQOracle<String, String>(config.max_depth, statsCachedEqOracle);
			break;
			
		case "randomwords":
			equivalenceAlgorithm = new MealyRandomWordsEQOracle<String, String>(statsCachedEqOracle, config.min_length, config.max_length, config.nr_queries, new Random(config.seed));
			break;
			
		default:
			throw new Exception("Unknown equivalence algorithm " + config.eqtest);
	}	
}
 
开发者ID:jderuiter,项目名称:statelearner,代码行数:36,代码来源:Learner.java

示例2: StepCounterSUL

import de.learnlib.api.SUL; //导入依赖的package包/类
public StepCounterSUL(SUL<Symbol, String> actualSUL){
	this.actualSUL = actualSUL;
}
 
开发者ID:mtappler,项目名称:mut-learn,代码行数:4,代码来源:StepCounterSUL.java

示例3: TestTrackingSUL

import de.learnlib.api.SUL; //导入依赖的package包/类
public TestTrackingSUL(SUL<Symbol, String> actualSUL) {
	this.actualSUL = actualSUL;
}
 
开发者ID:mtappler,项目名称:mut-learn,代码行数:4,代码来源:TestTrackingSUL.java

示例4: fork

import de.learnlib.api.SUL; //导入依赖的package包/类
public SUL<String, String> fork() throws UnsupportedOperationException {
	throw new UnsupportedOperationException("Cannot fork SocketSUL");
}
 
开发者ID:jderuiter,项目名称:statelearner,代码行数:4,代码来源:SocketSUL.java

示例5: fork

import de.learnlib.api.SUL; //导入依赖的package包/类
public SUL<String, String> fork() throws UnsupportedOperationException {
	throw new UnsupportedOperationException("Cannot fork SCSUL");
}
 
开发者ID:jderuiter,项目名称:statelearner,代码行数:4,代码来源:SCSUL.java

示例6: MealyLogOracle

import de.learnlib.api.SUL; //导入依赖的package包/类
public MealyLogOracle(SUL<I, O> sul, LearnLogger logger) {
	super(sul, logger);
}
 
开发者ID:jderuiter,项目名称:statelearner,代码行数:4,代码来源:LogOracle.java

示例7: LogOracle

import de.learnlib.api.SUL; //导入依赖的package包/类
public LogOracle(SUL<I,D> sul, LearnLogger logger) {        
    this.sul = sul;
    this.logger = logger;
}
 
开发者ID:jderuiter,项目名称:statelearner,代码行数:5,代码来源:LogOracle.java

示例8: loadLearningAlgorithm

import de.learnlib.api.SUL; //导入依赖的package包/类
public void loadLearningAlgorithm(String algorithm, SimpleAlphabet<String> alphabet, SUL<String, String> sul) throws Exception {
	// Create the membership oracle
	//memOracle = new SULOracle<String, String>(sul);
	// Add a logging oracle
	logMemOracle = new MealyLogOracle<String, String>(sul, LearnLogger.getLogger("learning_queries"));		
       // Count the number of queries actually sent to the SUL
	statsMemOracle = new MealyCounterOracle<String, String>(logMemOracle, "membership queries to SUL");
	// Use cache oracle to prevent double queries to the SUL
	//cachedMemOracle = MealyCacheOracle.createDAGCacheOracle(alphabet, statsMemOracle);
       // Count the number of queries to the cache
	statsCachedMemOracle = new MealyCounterOracle<String, String>(statsMemOracle, "membership queries to cache");
	
	// Instantiate the selected learning algorithm
	switch(algorithm.toLowerCase()) {
		case "lstar":
			learningAlgorithm = new ExtensibleLStarMealyBuilder<String, String>().withAlphabet(alphabet).withOracle(statsCachedMemOracle).create();
			break;
			 	
		case "dhc":
			learningAlgorithm = new MealyDHC<String, String>(alphabet, statsCachedMemOracle);
			break;
			
		case "kv":
			learningAlgorithm = new KearnsVaziraniMealy<String, String>(alphabet, statsCachedMemOracle, true, AcexAnalyzers.BINARY_SEARCH);
			break;
			
		case "ttt":
			AcexLocalSuffixFinder suffixFinder = new AcexLocalSuffixFinder(AcexAnalyzers.BINARY_SEARCH, true, "Analyzer");
			learningAlgorithm = new TTTLearnerMealy<String, String>(alphabet, statsCachedMemOracle, suffixFinder);
			break;
			
		case "mp":
			learningAlgorithm = new MalerPnueliMealy<String, String>(alphabet, statsCachedMemOracle);
			break;
			
		case "rs":
			learningAlgorithm = new RivestSchapireMealy<String, String>(alphabet, statsCachedMemOracle);
			break;

		default:
			throw new Exception("Unknown learning algorithm " + config.learning_algorithm);
	}		
}
 
开发者ID:jderuiter,项目名称:statelearner,代码行数:44,代码来源:Learner.java

示例9: AlexSUL

import de.learnlib.api.SUL; //导入依赖的package包/类
/**
 * @param inputSUL
 *         The SUL that will handle the actual requests.
 */
public AlexSUL(SUL<I, O> inputSUL) {
    this.inputSUL = inputSUL;
    resetCounter();
}
 
开发者ID:LearnLib,项目名称:alex,代码行数:9,代码来源:AlexSUL.java

示例10: fork

import de.learnlib.api.SUL; //导入依赖的package包/类
@Nonnull
@Override
public SUL<I, O> fork() throws UnsupportedOperationException {
    return symbolCounterSUL.fork();
}
 
开发者ID:LearnLib,项目名称:alex,代码行数:6,代码来源:AlexSUL.java

示例11: AbstractLearnerThread

import de.learnlib.api.SUL; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param user
 * @param learnerResultDAO {@link #learnerResultDAO}.
 * @param context          The context to use.
 * @param result           {@link #result}.
 * @param configuration    {@link #configuration}.
 */
public AbstractLearnerThread(User user, LearnerResultDAO learnerResultDAO,
                             ConnectorContextHandler context,
                             LearnerResult result,
                             T configuration) {
    this.user = user;
    this.learnerResultDAO = learnerResultDAO;
    this.result = result;
    this.configuration = configuration;
    this.abstractAlphabet = new SimpleAlphabet<>(
            result.getSymbols().stream()
                    .map(Symbol::getName)
                    .sorted(String::compareTo)
                    .collect(Collectors.toList())
    );

    this.finished = false;
    this.maxConcurrentQueries = context.getMaxConcurrentQueries();
    this.currentQueries = new ArrayList<>();

    // prepare the mapped sul.
    symbolMapper = new SymbolMapper(result.getSymbols());
    final ContextExecutableInputSUL<ContextExecutableInput<ExecuteResult, ConnectorManager>, ExecuteResult, ConnectorManager>
            ceiSUL = new ContextExecutableInputSUL<>(context);
    final SUL<String, String> mappedSUL = SULMappers.apply(symbolMapper, ceiSUL);
    this.sul = new AlexSUL<>(mappedSUL);

    this.multiSULOracle = new MultiSULOracle<>(sul);

    // monitor which queries are being processed.
    monitorOracle = new QueryMonitorOracle<>(multiSULOracle);
    monitorOracle.addPostProcessingListener(queries -> {
        List<DefaultQueryProxy> currentQueries = new ArrayList<>();
        queries.forEach(query -> currentQueries.add(DefaultQueryProxy.createFrom(new DefaultQuery<>(query))));
        this.currentQueries = currentQueries;
    });

    // create the concrete membership oracle.
    this.mqOracle = new DelegationOracle<>();
    if (result.isUseMQCache()) {
        this.mqOracle.setDelegate(MealyCacheOracle.createDAGCacheOracle(this.abstractAlphabet, monitorOracle));
    } else {
        this.mqOracle.setDelegate(monitorOracle);
    }

    // create the learner.
    this.learner = result.getAlgorithm().createLearner(abstractAlphabet, mqOracle);
}
 
开发者ID:LearnLib,项目名称:alex,代码行数:57,代码来源:AbstractLearnerThread.java

示例12: MultiSULOracle

import de.learnlib.api.SUL; //导入依赖的package包/类
/**
 * Constructor.
 *
 * @param sul The sul the membership queries should be posed to.
 */
public MultiSULOracle(SUL<I, O> sul) {
    this.sul = sul;
}
 
开发者ID:LearnLib,项目名称:alex,代码行数:9,代码来源:MultiSULOracle.java


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