public class CsvLogger
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DELIMITER |
Constructor and Description |
---|
CsvLogger(java.lang.String fileName)
Initializes a new instance of the CsvLogger class.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this stream and releases any system resources associated with it.
|
static java.lang.String |
getDefaultSessionLog(Session session,
MultilateralProtocol protocol,
java.util.List<NegotiationPartyInternal> partiesint,
double runTime)
Log default session information.
|
static java.util.List<java.lang.Double> |
getPerceivedUtils(java.util.List<NegotiationPartyInternal> parties,
Bid agreement,
boolean discount)
Asks the parties themselves for the perceived utilties; this may yield a
different number from the real utilities specified by
NegotiationPartyInternal in case of preference uncertainty. |
static java.util.List<java.lang.Double> |
getUtils(java.util.List<NegotiationPartyInternal> parties,
Bid agreement,
boolean discount) |
static java.lang.String |
join(java.util.Collection<?> s,
java.lang.String delimiter)
Helper method.
|
void |
log(java.lang.Object value)
Log a given object.
|
void |
logLine(java.lang.Object... values)
Logs a complete line to the file.
|
static java.lang.String |
logSingleSession(Session session,
MultilateralProtocol protocol,
java.util.List<NegotiationPartyInternal> partiesint,
double runTime) |
static java.lang.String |
stripPath(java.lang.String filenameWithPath) |
public static final java.lang.String DELIMITER
public CsvLogger(java.lang.String fileName) throws java.io.IOException
fileName
- The name of the file to log to (including the .csv extension)java.io.FileNotFoundException
- Thrown by the PrintStream if the location is not writable.java.io.IOException
public static java.lang.String join(java.util.Collection<?> s, java.lang.String delimiter)
s
- Collection of objects to create string ofdelimiter
- The delimiter used between objectpublic void log(java.lang.Object value)
value
- The object to logpublic void logLine(java.lang.Object... values)
values
- zero or more objects to log, using ; delimiterpublic static java.lang.String getDefaultSessionLog(Session session, MultilateralProtocol protocol, java.util.List<NegotiationPartyInternal> partiesint, double runTime) throws java.lang.Exception
java.lang.Exception
public static java.util.List<java.lang.Double> getUtils(java.util.List<NegotiationPartyInternal> parties, Bid agreement, boolean discount)
parties
- the parties in the negoagreement
- the reached agreement, or null if there was no agreement.discount
- true iff you want the discounted utilities.public static java.util.List<java.lang.Double> getPerceivedUtils(java.util.List<NegotiationPartyInternal> parties, Bid agreement, boolean discount)
NegotiationPartyInternal
in case of preference uncertainty.public static java.lang.String logSingleSession(Session session, MultilateralProtocol protocol, java.util.List<NegotiationPartyInternal> partiesint, double runTime) throws java.lang.Exception
session
- protocol
- partiesint
- runTime
- java.lang.Exception
public static java.lang.String stripPath(java.lang.String filenameWithPath)
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
- if an I/O error occurs