HtmlTrace logs simulation events of all model components to a html file or an open output stream. If the user provides a filename HtmlTrace opens and closes this file automatically.
class UserSimulation : public Simulation { ... public: HtmlTrace* myTrace; ... virtual void initSimulation() { myTrace = new HtmlTrace(this, "MyTrace.html");
addConsumer(myTrace);
myTrace->setFilter("none; st:class odemx::Condq;");
startTrace(); ... } ... int main() { UserSimulation sim; sim.runUntil(20.0); sim.pauseTrace(); sim.runUntil(25.0); sim.continueTrace(); sim.runUntil(31.0);
sim.stopTrace(); sim.run(); }
in main() { UserSimulation sim; HtmlTrace mySecondTrace(&sim, "My2Trace.html"); mySecondTrace.setFilter("all; sl: MyCondq"); sim.addConsumer(&mySecondTrace); ... }
Public Member Functions | |
Construction | |
HtmlTrace (Simulation *s, const char *filename=0) | |
HtmlTrace (Simulation *s, std::ostream &os) | |
Destruction | |
virtual | ~HtmlTrace () |
Filter | |
virtual void | setFilter (const char *f) |
Set trace filter. |
|
filename and writes into this file. When HtmlTrace is deleted the file is closed. If HtmlTrace fails to open the file the output is send to stdout . |
|
os . |
|
In case HtmlTrace has opened a file it is closed by the destructor. |
|
Set trace filter.
f . The string is read from left to right. If the keywords none or all are found the filter-policy is set. The last occurrence of one of these keywords is used. If none of these keywords is found all is used by default. The none policy blocks all marks except those specified in the string f . The all policy passes all marks except those specified in the string f . A mark can be specified by its MarkType or its sender. The MarkType consists of the MarkTypeId, the MarkTypeName and the scope of the mark. Each of these fields can be used to specify Marks. The keyword mti : is used to specify MarkTypeIds: mti:1 mti: 345; mti:1334; mti: 15, 2354, 2; mtn : can be used to specify MarktTypeNames: mtn:begin mtn:end , activate; mtn: destroy; mts : is used to specify a scope: mts:class odemx::Process mts:class odemx::Res, class odemx::Bin; mts: class odemx::Waitq; sl : is used to specify the label: sl:MyWaitq, Car sl: Client 2, Client 3; sl: Servant; st : specifies the sender type: st:class ServantType, class Bin
st:class MyTestProcess1; st:class Storage
|