mc_model_checker->exit(status);
}
-std::string Api::request_get_dot_output(const Transition* t) const
-{
- static constexpr std::array<const char*, 13> colors{{"blue", "red", "green3", "goldenrod", "brown", "purple",
- "magenta", "turquoise4", "gray25", "forestgreen", "hotpink",
- "lightblue", "tan"}};
- const char* color = colors[(t->aid_ - 1) % colors.size()];
-
- return "label = \"" + t->dot_label() + "\", color = " + color + ", fontcolor = " + color;
-}
-
void Api::restore_state(std::shared_ptr<simgrid::mc::Snapshot> system_state) const
{
system_state->restore(&mc_model_checker->get_remote_process());
unsigned long mc_get_visited_states() const;
XBT_ATTRIB_NORETURN void mc_exit(int status) const;
- // SIMCALL APIs
- std::string request_get_dot_output(const Transition* t) const;
-
// STATE APIs
void restore_state(std::shared_ptr<simgrid::mc::Snapshot> system_state) const;
this->previous_request_.clear();
}
this->previous_pair_ = current_pair->num;
- this->previous_request_ = api::get().request_get_dot_output(current_pair->graph_state->get_transition());
+ this->previous_request_ = current_pair->graph_state->get_transition()->dot_string();
if (current_pair->search_cycle)
fprintf(dot_output, "%d [shape=doublecircle];\n", current_pair->num);
fflush(dot_output);
std::string req_str;
if (dot_output != nullptr)
- req_str = api::get().request_get_dot_output(state->get_transition());
+ req_str = state->get_transition()->dot_string();
/* Create the new expanded state (copy the state of MCed into our MCer data) */
auto next_state = std::make_unique<State>();
{
return "";
}
-std::string Transition::dot_label() const
+std::string Transition::dot_string() const
{
- return xbt::string_printf("[(%ld)] %s", aid_, Transition::to_c_str(type_));
+ static constexpr std::array<const char*, 13> colors{{"blue", "red", "green3", "goldenrod", "brown", "purple",
+ "magenta", "turquoise4", "gray25", "forestgreen", "hotpink",
+ "lightblue", "tan"}};
+ const char* color = colors[(aid_ - 1) % colors.size()];
+
+ return xbt::string_printf("label = \"[(%ld)] %s\", color = %s, fontcolor = %s", aid_, Transition::to_c_str(type_),
+ color, color);
}
void Transition::replay() const
{
}
virtual ~Transition();
+ /** Returns a textual representation of the transition. Pointer adresses are omitted if verbose=false */
virtual std::string to_string(bool verbose = false) const;
- virtual std::string dot_label() const;
+ /** Returns something like >>label = "desc", color = c<< to describe the transition in dot format */
+ virtual std::string dot_string() const;
/* Moves the application toward a path that was already explored, but don't change the current transition */
void replay() const;
xbt_assert(stream >> min_ >> max_);
}
-std::string RandomTransition::dot_label() const
-{
- return Transition::dot_label() + to_c_str(type_);
-}
-
} // namespace mc
} // namespace simgrid
public:
std::string to_string(bool verbose) const override;
- std::string dot_label() const override;
RandomTransition(aid_t issuer, int times_considered, std::stringstream& stream);
bool depends(const Transition* other) const override { return false; } // Independent with any other transition
};