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

LearnLib / learnlib / 6433387082

06 Oct 2023 03:10PM UTC coverage: 92.296% (-0.007%) from 92.303%
6433387082

push

github

mtf90
update Falk's developer id

11573 of 12539 relevant lines covered (92.3%)

1.67 hits per line

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

83.33
/algorithms/active/ttt-vpa/src/main/java/de/learnlib/algorithms/ttt/vpa/NonDetState.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.algorithms.ttt.vpa;
17

18
import java.util.Collections;
19
import java.util.Set;
20

21
import net.automatalib.automata.vpa.State;
22

23
/**
24
 * @param <L>
25
 *         location type
26
 */
27
final class NonDetState<L> {
2✔
28

29
    private final NondetStackContents stack;
30
    private final Set<L> locations;
31

32
    NonDetState(Set<L> locations, NondetStackContents stack) {
2✔
33
        this.locations = locations;
2✔
34
        this.stack = stack;
2✔
35
    }
2✔
36

37
    public static <L> NonDetState<L> fromDet(State<L> state) {
38
        return new NonDetState<>(Collections.singleton(state.getLocation()),
2✔
39
                                 NondetStackContents.fromDet(state.getStackContents()));
2✔
40
    }
41

42
    public State<L> determinize() {
43
        assert !isNonDet();
×
44
        return new State<>(locations.iterator().next(), NondetStackContents.toDet(stack));
×
45
    }
46

47
    @SuppressWarnings("PMD.UselessParentheses") // to make it explicit which binary operator has higher precedence
48
    public boolean isNonDet() {
49
        return locations.size() > 1 || (stack != null && stack.isTrueNondet());
2✔
50
    }
51

52
    public NondetStackContents getStack() {
53
        return stack;
2✔
54
    }
55

56
    public Set<L> getLocations() {
57
        return locations;
2✔
58
    }
59

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

© 2026 Coveralls, Inc