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

LearnLib / automatalib / 13100258666

02 Feb 2025 03:46PM UTC coverage: 92.108% (+0.1%) from 92.01%
13100258666

push

github

mtf90
provide some default methods for {Mutable,]ProbabilisticMealy

including tests

4 of 4 new or added lines in 2 files covered. (100.0%)

18 existing lines in 7 files now uncovered.

16609 of 18032 relevant lines covered (92.11%)

1.7 hits per line

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

88.89
/core/src/main/java/net/automatalib/graph/impl/CompactPMPG.java
1
/* Copyright (C) 2013-2025 TU Dortmund University
2
 * This file is part of AutomataLib <https://automatalib.net>.
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 net.automatalib.graph.impl;
17

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

21
import net.automatalib.common.util.array.ArrayStorage;
22
import net.automatalib.graph.MutableProceduralModalProcessGraph;
23
import net.automatalib.graph.base.AbstractCompactUniversalGraph;
24
import net.automatalib.ts.modal.transition.MutableProceduralModalEdgeProperty;
25
import org.checkerframework.checker.nullness.qual.Nullable;
26

27
public class CompactPMPG<L, AP>
28
        extends AbstractCompactUniversalGraph<CompactPMPGEdge<L, MutableProceduralModalEdgeProperty>, Set<AP>, MutableProceduralModalEdgeProperty>
29
        implements MutableProceduralModalProcessGraph<Integer, L, CompactPMPGEdge<L, MutableProceduralModalEdgeProperty>, AP, MutableProceduralModalEdgeProperty> {
30

31
    private final ArrayStorage<Set<AP>> nodeProperties;
32
    private final L defaultLabel;
33
    private int initialNode;
34
    private int finalNode;
35

36
    public CompactPMPG(L defaultLabel) {
1✔
37
        this.nodeProperties = new ArrayStorage<>();
1✔
38
        this.defaultLabel = defaultLabel;
1✔
39
        this.initialNode = -1;
1✔
40
        this.finalNode = -1;
1✔
41
    }
1✔
42

43
    @Override
44
    public void setInitialNode(@Nullable Integer initialNode) {
45
        if (initialNode == null) {
1✔
UNCOV
46
            this.initialNode = -1;
×
47
        } else {
48
            this.initialNode = initialNode;
1✔
49
        }
50
    }
1✔
51

52
    @Override
53
    public void setFinalNode(@Nullable Integer finalNode) {
54
        if (finalNode == null) {
1✔
UNCOV
55
            this.finalNode = -1;
×
56
        } else {
57
            this.finalNode = finalNode;
1✔
58
        }
59
    }
1✔
60

61
    @Override
62
    public L getEdgeLabel(CompactPMPGEdge<L, MutableProceduralModalEdgeProperty> edge) {
63
        return edge.getLabel();
1✔
64
    }
65

66
    @Override
67
    public void setEdgeLabel(CompactPMPGEdge<L, MutableProceduralModalEdgeProperty> edge, L label) {
68
        edge.setLabel(label);
1✔
69
    }
1✔
70

71
    @Override
72
    public @Nullable Integer getFinalNode() {
73
        return this.finalNode < 0 ? null : this.finalNode;
1✔
74
    }
75

76
    @Override
77
    public @Nullable Integer getInitialNode() {
78
        return this.initialNode < 0 ? null : this.initialNode;
1✔
79
    }
80

81
    @Override
82
    public void setNodeProperty(int node, Set<AP> property) {
83
        nodeProperties.ensureCapacity(node + 1);
1✔
84
        nodeProperties.set(node, property);
1✔
85
    }
1✔
86

87
    @Override
88
    protected CompactPMPGEdge<L, MutableProceduralModalEdgeProperty> createEdge(int source,
89
                                                                                int target,
90
                                                                                MutableProceduralModalEdgeProperty property) {
91
        return new CompactPMPGEdge<>(target, property, this.defaultLabel);
1✔
92
    }
93

94
    @Override
95
    public Set<AP> getNodeProperty(int node) {
96
        if (node > nodeProperties.size()) {
1✔
UNCOV
97
            return Collections.emptySet();
×
98
        }
99

100
        final Set<AP> props = nodeProperties.get(node);
1✔
101
        return props == null ? Collections.emptySet() : props;
1✔
102
    }
103
}
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