Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPN unfolding bug - fix 2081147 #173

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
nbproject/
cmake-build-*
.idea/
.vscode
src/PetriEngine/PQL/PQLQueryParser.parser.cpp
src/PetriEngine/PQL/PQLQueryParser.parser.hpp
src/PetriEngine/PQL/PQLQueryTokens.lexer.cpp
Expand Down
8 changes: 5 additions & 3 deletions include/PetriEngine/Colored/ArcIntervalVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,12 @@ namespace PetriEngine {
return;
}

old_intervals._intervalTupleVec.insert(
old_intervals._intervalTupleVec.end(),
_arcIntervals._intervalTupleVec.begin(), _arcIntervals._intervalTupleVec.end());
}

old_intervals._intervalTupleVec.insert(
old_intervals._intervalTupleVec.end(),
_arcIntervals._intervalTupleVec.begin(), _arcIntervals._intervalTupleVec.end());

std::swap(old_intervals, _arcIntervals);
}

Expand Down
2 changes: 1 addition & 1 deletion include/PetriEngine/Colored/ArcIntervals.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace PetriEngine {
: _varIndexModMap(std::move(varIndexModMap)), _intervalTupleVec(std::move(ranges)) {
};

void print() {
void print() const {
std::cout << "[ ";
for(auto& varModifierPair : _varIndexModMap){
std::cout << "(" << varModifierPair.first->name << ", " << varModifierPair.first->colorType->productSize() << ") ";
Expand Down
5 changes: 3 additions & 2 deletions src/PetriEngine/Colored/IntervalGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ namespace PetriEngine {

std::vector<interval_t> IntervalGenerator::getIntervalsFromInterval(const interval_t &interval, uint32_t varPosition, int32_t varModifier, const std::vector<const ColorType*> &varColorTypes) {
std::vector<interval_t> varIntervals;
interval_t firstVarInterval;
varIntervals.push_back(firstVarInterval);
varIntervals.emplace_back();
for(uint32_t i = varPosition; i < varPosition + varColorTypes.size(); i++){
auto ctSize = varColorTypes[i - varPosition]->size();
int32_t lower_val = ctSize + (interval[i]._lower + varModifier);
Expand Down Expand Up @@ -131,6 +130,8 @@ namespace PetriEngine {
interval_vector_t varIntervals;
std::vector<const ColorType*> varColorTypes;
pair.first->colorType->getColortypes(varColorTypes);

assert(pair.second.size() > tuplePos);
getArcVarIntervals(varIntervals, pair.second[tuplePos], interval, varColorTypes);

if(arcIntervals._intervalTupleVec.size() > 1 && pair.second[tuplePos].empty()){
Expand Down
3 changes: 1 addition & 2 deletions src/PetriEngine/Colored/PartitionBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,7 @@ namespace PetriEngine {
const VariableModifierMap &varModifierMap,
const EquivalenceClass& eqClass , const Arc *arc, uint32_t placeId){
std::vector<VariableIntervalMap> varMaps;
VariableIntervalMap varMap;
varMaps.push_back(varMap);
varMaps.emplace_back();
std::unordered_map<uint32_t, ArcIntervals> placeArcIntervals;
ColorFixpoint postPlaceFixpoint;
postPlaceFixpoint.constraints = eqClass.intervals();
Expand Down
Loading