• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Build has been canceled!

LearnLib / learnlib / 6605620268

22 Oct 2023 06:53PM UTC coverage: 93.218% (+0.9%) from 92.296%
6605620268

push

github

mtf90
cleanup passive integration tests

11546 of 12386 relevant lines covered (93.22%)

1.68 hits per line

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

92.31
/algorithms/passive/rpni/src/main/java/de/learnlib/algorithm/rpni/BlueFringeRPNIDFA.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.algorithm.rpni;
17

18
import java.util.Collection;
19

20
import de.learnlib.api.algorithm.PassiveLearningAlgorithm;
21
import de.learnlib.api.algorithm.PassiveLearningAlgorithm.PassiveDFALearner;
22
import de.learnlib.api.query.DefaultQuery;
23
import de.learnlib.datastructure.pta.BlueFringePTADFA;
24
import net.automatalib.alphabet.Alphabet;
25
import net.automatalib.automaton.fsa.DFA;
26

27
/**
28
 * A Blue Fringe version of RPNI for learning DFAs.
29
 * <p>
30
 * <b>Implementation note:</b> This implementation does not support repeated calls to {@link
31
 * PassiveLearningAlgorithm#computeModel()}.
32
 *
33
 * @param <I>
34
 *         input symbol type
35
 */
36
public class BlueFringeRPNIDFA<I>
37
        extends AbstractBlueFringeRPNI<I, Boolean, Boolean, Void, DFA<?, I>, BlueFringePTADFA<I>>
38
        implements PassiveDFALearner<I> {
39

40
    private final BlueFringePTADFA<I> pta;
41
    private boolean merged;
42

43
    /**
44
     * Constructor.
45
     *
46
     * @param alphabet
47
     *         the alphabet
48
     */
49
    public BlueFringeRPNIDFA(Alphabet<I> alphabet) {
50
        super(alphabet);
2✔
51
        this.pta = new BlueFringePTADFA<>(alphabet);
2✔
52
        this.merged = false;
2✔
53
    }
2✔
54

55
    @Override
56
    public void addSamples(Collection<? extends DefaultQuery<I, Boolean>> samples) {
57
        for (DefaultQuery<I, Boolean> query : samples) {
2✔
58
            pta.addSample(query.getInput(), query.getOutput());
2✔
59
        }
2✔
60
    }
2✔
61

62
    @Override
63
    protected BlueFringePTADFA<I> fetchPTA() {
64
        if (merged) {
2✔
65
            throw new IllegalStateException(
×
66
                    "A model has already been computed once. This learner does not support repeated model constructions");
67
        }
68
        merged = true;
2✔
69

70
        return this.pta;
2✔
71
    }
72

73
    @Override
74
    protected DFA<?, I> ptaToModel(BlueFringePTADFA<I> pta) {
75
        return pta.asDFA();
2✔
76
    }
77

78
}
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