From powerwiki
Jump to: navigation, search

The state log generated by the Power TAC simulation is in a simple flat format that's intended to record "significant" state changes while the simulator runs. It is not in XML or JSON format because it's not just objects that are logged, and because object references are all indirect; there is no nesting. Each record is a single line in a text file.

The format of each line is formatted as


Fields are

Milliseconds since process start. Note that this is not time in the simulation environment, but "wall clock" time in the real world. Entries in the trace log are also prefixed with the same msec field, which makes it easy to line up trace log entries with state log entries.
The fully-qualified name of the class of the object being logged.
The numeric ID of the object. A few logged types do not have ID values, in which case this field is null. The most common example is org.powertac.common.TimeService.
The name of the method that was called. For object creation events, this is new if the object was created directly in the simulation, or -rr if the object was received from some broker and created by the Java read-resolve process.
Method, constructor, or read-resolve argument. In many cases this is the ID of some other object. Note that for read-resolve records, an object reference often precedes the object being referenced. For example, when a broker sends a new TariffSpecification, its Rate instances are sent first, and each Rate includes a reference (ID value) for the TariffSpecification. These individual objects are logged as they arrive.

The meaning and order of arguments are specific to the object and method. For new and other method calls, the order and meanings of the arguments comes from the signature of the constructor or method. For example, this entry


represents creation of a new Order instance inside the simulation server. The constructor is

 Order (Broker broker, int timeslot, double mWh, Double limitPrice)

Here we have a new Order, ID 7181, being created by broker ID 1890, offering to sell 25.7 MWh for at least $140.38. Who is broker 1890?


It's a CpGenco inside the simulation, which generates the supply curve in the wholesale market.

For read-resolve records, the arguments are documented in the @Domain annotation on the class. Here are the fields for the Rate class:

 @Domain (fields = {"tariffId", "weeklyBegin", "weeklyEnd", "dailyBegin", "dailyEnd",
                    "tierThreshold", "fixed", "minValue", "maxValue",
                    "noticeInterval", "expectedMean", "maxCurtailment"})

and here is an incoming Rate instance:


Here are the read-resolve arguments for TariffSpecification:

 @Domain(fields = {"broker", "powerType", "minDuration",
                   "signupPayment", "earlyWithdrawPayment", "periodicPayment",

Here is the incoming TariffSpecification for the Rate we just saw:


We can see that the ID for this object is the same as the "tariffId" field in the Rate, and that the first argument is the broker ID. The minDuration is in msec -- if you convert to hours, it's 120 hours or 5 days. Which broker is this? It was created much earlier: