Example #1
0
/**
 * Return a formatted string containing:
 * - the name of the policy (in C++ mangled form),
 * - migration type,
 * - migration rate,
 * - the output of human_readable_extra().
 *
 * @return human readable representation of the policy.
 */
std::string base::human_readable() const
{
	std::ostringstream oss;
	oss << "Policy name: " << typeid(*this).name() << '\n';
	oss << "\tMigration type: " << ((m_type) ? "fractional" : "absolute") << '\n';
	oss << "\tMigration rate: " << ((m_type) ? (m_rate * 100) : m_rate) << ((m_type) ? "%" : "") << '\n';
	oss << human_readable_extra();
	return oss.str();
}
Example #2
0
/**
 * Will return a formatted string containing:
 * - the output of get_name(),
 * - the number of vertices,
 * - the output of human_readable_extra().
 *
 * @return string containing terse human readable representation of the topology.
 */
std::string base::human_readable_terse() const
{
	std::ostringstream s;
	s << "Topology type: " << get_name() << '\n';
	s << "\tNumber of vertices: " << get_number_of_vertices() << '\n';
	s << "\tNumber of edges: " << get_number_of_edges() << '\n';
	s << human_readable_extra() << '\n';
	return s.str();
}