Skip to content

Commit

Permalink
fixed unfolding
Browse files Browse the repository at this point in the history
  • Loading branch information
mtygesen committed Oct 7, 2024
1 parent 8b7b23e commit eab0339
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
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

0 comments on commit eab0339

Please sign in to comment.