Skip to content
Snippets Groups Projects
Commit 0db230e9 authored by Jaime Arias's avatar Jaime Arias
Browse files

wip: compute weight of an aggregate

parent fcd3ee89
No related branches found
No related tags found
No related merge requests found
Pipeline #9315 passed
......@@ -509,6 +509,23 @@ Path PetriNetSOG::AbstractPath(Path path, const SOG &sog) const {
return abstract_paths;
}
int PetriNetSOG::ComputeWeightOfAggregate(const Aggregate *aggr,
const int t_source,
const int t_target) const {
const bdd source = relation[t_source][aggr->state];
// backtracking from t_target until t_source
int counter = 0;
bdd current_state = SearchExitPoints(aggr->state, t_target);
while ((source & current_state) == bdd_false()) {
pair<int, bdd> step = StepBackward(current_state, aggr);
current_state = step.second & aggr->state; // keep in the aggregate
counter++;
}
return counter;
}
Path PetriNetSOG::SubPathAggregate(bdd *source, const bdd &target,
const Aggregate *aggr) const {
Path path;
......
......@@ -170,6 +170,15 @@ class PetriNetSOG {
* @return abstract path
*/
Path AbstractPath(Path path, const SOG& sog) const;
/**
* Compute the weights of the shortest paths inside the aggregate
* @param aggr aggregate
* @param t_source source transition
* @param t_target target transition
*/
int ComputeWeightOfAggregate(const Aggregate* aggr, int t_source,
int t_target) const;
};
#endif // PETRI_NET_SOG_H_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment