Prints models and solving statistics in Json-format to stdout. More...
#include <clasp_output.h>
Public Member Functions | |
JsonOutput (uint32 verb) | |
virtual void | printStatistics (const ClaspFacade::Summary &summary, bool final) |
Shall print the given statistics. | |
virtual void | printSummary (const ClaspFacade::Summary &summary, bool final) |
Shall print the given summary. | |
virtual void | run (const char *solver, const char *version, const std::string *begInput, const std::string *endInput) |
Shall be called once on startup. | |
virtual void | shutdown (const ClaspFacade::Summary &summary) |
Shall be called once on shutdown. | |
virtual void | shutdown () |
~JsonOutput () | |
Private Types | |
enum | ObjType { type_object, type_array } |
Private Member Functions | |
bool | hasWitness () const |
uint32 | indent () const |
char | popObject () |
void | printCosts (const SharedMinimizeData &costs) |
void | printKey (const char *k) |
void | printKeyValue (const char *k, const char *v) |
void | printKeyValue (const char *k, uint64 v) |
void | printKeyValue (const char *k, uint32 v) |
void | printKeyValue (const char *k, double d) |
void | printModel (const SymbolTable &sym, const Model &m, PrintLevel x) |
Shall print the given model. | |
void | printString (const char *s, const char *sep) |
void | pushObject (const char *k=0, ObjType t=type_object) |
void | startModel () |
virtual void | startStep (const ClaspFacade &) |
A solving step has started. | |
virtual void | stopStep (const ClaspFacade::Summary &summary) |
A solving step has stopped. | |
virtual void | visitCoreSolverStats (double cpuTime, uint64 models, const SolverStats &stats, bool accu) |
virtual void | visitExtSolverStats (const ExtendedStats &stats, bool accu) |
virtual void | visitHcc (uint32 i, const SharedContext &ctx) |
virtual void | visitHccs (const SharedContext &ctx) |
virtual void | visitJumpStats (const JumpStats &stats, bool accu) |
virtual void | visitLogicProgramStats (const Asp::LpStats &stats) |
virtual void | visitProblemStats (const ProblemStats &stats) |
virtual void | visitThread (uint32 i, const SolverStats &stats) |
virtual void | visitThreads (const SharedContext &ctx) |
Private Attributes | |
std::string | objStack_ |
const char * | open_ |
Prints models and solving statistics in Json-format to stdout.
Definition at line 127 of file clasp_output.h.
enum Clasp::Cli::JsonOutput::ObjType [private] |
Definition at line 148 of file clasp_output.h.
Clasp::Cli::JsonOutput::JsonOutput | ( | uint32 | verb | ) | [explicit] |
Definition at line 215 of file clasp_output.cpp.
Definition at line 218 of file clasp_output.cpp.
bool Clasp::Cli::JsonOutput::hasWitness | ( | ) | const [inline, private] |
Definition at line 160 of file clasp_output.h.
uint32 Clasp::Cli::JsonOutput::indent | ( | ) | const [inline, private] |
Definition at line 161 of file clasp_output.h.
char Clasp::Cli::JsonOutput::popObject | ( | ) | [private] |
Definition at line 453 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::printCosts | ( | const SharedMinimizeData & | costs | ) | [private] |
Definition at line 498 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::printKey | ( | const char * | k | ) | [private] |
Definition at line 405 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::printKeyValue | ( | const char * | k, |
const char * | v | ||
) | [private] |
Definition at line 426 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::printKeyValue | ( | const char * | k, |
uint64 | v | ||
) | [private] |
Definition at line 431 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::printKeyValue | ( | const char * | k, |
uint32 | v | ||
) | [private] |
Definition at line 435 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::printKeyValue | ( | const char * | k, |
double | d | ||
) | [private] |
Definition at line 436 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::printModel | ( | const SymbolTable & | sym, |
const Model & | m, | ||
PrintLevel | x | ||
) | [private, virtual] |
Shall print the given model.
Implements Clasp::Cli::Output.
Definition at line 468 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::printStatistics | ( | const ClaspFacade::Summary & | summary, |
bool | final | ||
) | [virtual] |
Shall print the given statistics.
Implements Clasp::Cli::Output.
Definition at line 543 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::printString | ( | const char * | s, |
const char * | sep | ||
) | [private] |
Definition at line 410 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::printSummary | ( | const ClaspFacade::Summary & | summary, |
bool | final | ||
) | [virtual] |
Shall print the given summary.
Implements Clasp::Cli::Output.
Definition at line 509 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::pushObject | ( | const char * | k = 0 , |
ObjType | t = type_object |
||
) | [private] |
Definition at line 441 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::run | ( | const char * | solver, |
const char * | version, | ||
const std::string * | begInput, | ||
const std::string * | endInput | ||
) | [virtual] |
Shall be called once on startup.
Implements Clasp::Cli::Output.
Definition at line 219 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::shutdown | ( | const ClaspFacade::Summary & | summary | ) | [virtual] |
Shall be called once on shutdown.
Reimplemented from Clasp::Cli::Output.
Definition at line 233 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::shutdown | ( | ) | [virtual] |
Implements Clasp::Cli::Output.
Definition at line 240 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::startModel | ( | ) | [private] |
Definition at line 461 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::startStep | ( | const ClaspFacade & | ) | [private, virtual] |
A solving step has started.
Reimplemented from Clasp::Cli::Output.
Definition at line 247 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::stopStep | ( | const ClaspFacade::Summary & | summary | ) | [private, virtual] |
A solving step has stopped.
Reimplemented from Clasp::Cli::Output.
Definition at line 251 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::visitCoreSolverStats | ( | double | cpuTime, |
uint64 | models, | ||
const SolverStats & | stats, | ||
bool | accu | ||
) | [private, virtual] |
Implements Clasp::Cli::StatsVisitor.
Definition at line 257 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::visitExtSolverStats | ( | const ExtendedStats & | stats, |
bool | accu | ||
) | [private, virtual] |
Implements Clasp::Cli::StatsVisitor.
Definition at line 271 of file clasp_output.cpp.
virtual void Clasp::Cli::JsonOutput::visitHcc | ( | uint32 | i, |
const SharedContext & | ctx | ||
) | [inline, private, virtual] |
Reimplemented from Clasp::Cli::StatsVisitor.
Definition at line 142 of file clasp_output.h.
virtual void Clasp::Cli::JsonOutput::visitHccs | ( | const SharedContext & | ctx | ) | [inline, private, virtual] |
Reimplemented from Clasp::Cli::StatsVisitor.
Definition at line 140 of file clasp_output.h.
void Clasp::Cli::JsonOutput::visitJumpStats | ( | const JumpStats & | stats, |
bool | accu | ||
) | [private, virtual] |
Implements Clasp::Cli::StatsVisitor.
Definition at line 326 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::visitLogicProgramStats | ( | const Asp::LpStats & | stats | ) | [private, virtual] |
Implements Clasp::Cli::StatsVisitor.
Definition at line 343 of file clasp_output.cpp.
void Clasp::Cli::JsonOutput::visitProblemStats | ( | const ProblemStats & | stats | ) | [private, virtual] |
Implements Clasp::Cli::StatsVisitor.
Definition at line 391 of file clasp_output.cpp.
virtual void Clasp::Cli::JsonOutput::visitThread | ( | uint32 | i, |
const SolverStats & | stats | ||
) | [inline, private, virtual] |
Reimplemented from Clasp::Cli::StatsVisitor.
Definition at line 141 of file clasp_output.h.
virtual void Clasp::Cli::JsonOutput::visitThreads | ( | const SharedContext & | ctx | ) | [inline, private, virtual] |
Reimplemented from Clasp::Cli::StatsVisitor.
Definition at line 139 of file clasp_output.h.
std::string Clasp::Cli::JsonOutput::objStack_ [private] |
Definition at line 163 of file clasp_output.h.
const char* Clasp::Cli::JsonOutput::open_ [private] |
Definition at line 162 of file clasp_output.h.