• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LearnLib / learnlib / 6877022493

15 Nov 2023 12:04PM CUT coverage: 93.36%. First build
6877022493

push

github

mtf90
[maven-release-plugin] prepare release learnlib-0.17.0

11755 of 12591 relevant lines covered (93.36%)

1.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/commons/util/src/main/java/de/learnlib/util/nfa/NFALearnerWrapper.java
1
/* Copyright (C) 2013-2023 TU Dortmund
2
 * This file is part of LearnLib, http://www.learnlib.de/.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package de.learnlib.util.nfa;
17

18
import de.learnlib.algorithm.LearningAlgorithm;
19
import de.learnlib.query.DefaultQuery;
20
import net.automatalib.alphabet.Alphabet;
21
import net.automatalib.automaton.fsa.CompactDFA;
22
import net.automatalib.automaton.fsa.NFA;
23
import net.automatalib.util.automaton.fsa.NFAs;
24

25
public class NFALearnerWrapper<I> implements LearningAlgorithm.DFALearner<I> {
26

27
    private final Alphabet<I> alphabet;
28
    private final LearningAlgorithm<? extends NFA<?, I>, I, Boolean> nfaLearner;
29

30
    public NFALearnerWrapper(Alphabet<I> alphabet, LearningAlgorithm<? extends NFA<?, I>, I, Boolean> nfaLearner) {
×
31
        this.alphabet = alphabet;
×
32
        this.nfaLearner = nfaLearner;
×
33
    }
×
34

35
    @Override
36
    public void startLearning() {
37
        nfaLearner.startLearning();
×
38
    }
×
39

40
    @Override
41
    public boolean refineHypothesis(DefaultQuery<I, Boolean> ceQuery) {
42
        return nfaLearner.refineHypothesis(ceQuery);
×
43
    }
44

45
    @Override
46
    public CompactDFA<I> getHypothesisModel() {
47
        NFA<?, I> nfaHyp = nfaLearner.getHypothesisModel();
×
48
        return NFAs.determinize(nfaHyp, alphabet);
×
49
    }
50

51
    @Override
52
    public String toString() {
53
        return nfaLearner.toString();
×
54
    }
55

56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc