Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
srba committed Dec 30, 2023
1 parent d6d7cd8 commit ccba15d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
7 changes: 2 additions & 5 deletions include/Colored/ColoredPetriNetBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace unfoldtacpn {
typedef std::unordered_map<std::string, std::vector<std::string>> PTTransitionMap;

public:
ColoredPetriNetBuilder(const bool print_binding=false);
ColoredPetriNetBuilder(std::ostream* output_stream = nullptr);
ColoredPetriNetBuilder(const ColoredPetriNetBuilder& orig);
virtual ~ColoredPetriNetBuilder();
void parseNet(std::istream& istream);
Expand Down Expand Up @@ -82,9 +82,6 @@ namespace unfoldtacpn {
return _pttransitionnames;
}

const bool getPrintBindingStatus() const {
return _print_binding;
}

void unfold(TAPNBuilderInterface& builder);
void clear() { _sumPlacesNames.clear(); _pttransitionnames.clear(); _ptplacenames.clear(); }
Expand All @@ -103,7 +100,7 @@ namespace unfoldtacpn {
ColorTypeMap _colors;
double _time;

bool _print_binding;
std::ostream* _output_stream;

std::string arcToString(const Colored::Arc& arc) const;
const std::string& findSumName(const std::string& id) const;
Expand Down
12 changes: 6 additions & 6 deletions src/Colored/ColoredPetriNetBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "errorcodes.h"

namespace unfoldtacpn {
ColoredPetriNetBuilder::ColoredPetriNetBuilder(const bool print_binding):
_print_binding(print_binding)
ColoredPetriNetBuilder::ColoredPetriNetBuilder(std::ostream* output_stream):
_output_stream(output_stream)
{

}
Expand Down Expand Up @@ -196,7 +196,7 @@ namespace unfoldtacpn {
unfoldPlace(builder, place);
}

if (getPrintBindingStatus()) {
if (_output_stream)) {
std::cout << "Printing bindings for each unfolded transition.\n";
std::cout << "<bindings>\n";
}
Expand All @@ -205,7 +205,7 @@ namespace unfoldtacpn {
unfoldTransition(builder, transition);
}

if (getPrintBindingStatus()) {
if (_output_stream)) {
std::cout << "</bindings>\n";
}

Expand Down Expand Up @@ -302,8 +302,8 @@ namespace unfoldtacpn {
//if(!gen.isInitial())
name += "__" + std::to_string(i++);

// Print bindings for each transition
if (getPrintBindingStatus()) {
// Print bindings for each transition if output stream is not null
if (_output_stream)) {
std::cout << " <transition id=\"" << name << "\">\n";
for(auto const &var: b) {
std::cout << " <variable id=\"" << var.first << "\">\n";
Expand Down

0 comments on commit ccba15d

Please sign in to comment.