|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object SimReport
public class SimReport
Records any information that is needed by a GridSim entity.
It is the responsibility of each entity to record data.
NOTE: before the simulation ends, call finalWrite()
to finalize writing the data into a file and close it.
Forgotten to call this method will result in not writing
into a file at all.
Given the file name, this class will record information in CSV (Comma delimited) format (*.csv) with the first column usually represents the simulation time. The format of the next columns afterward is the responsibility of the coder.
Field Summary | |
---|---|
static int |
INDENT_COMMA
A comma-delimited text file, i.e. |
static int |
INDENT_SPACE
A space-delimited text file, i.e. |
static int |
INDENT_TAB
A tab-delimited text file, i.e. |
Constructor Summary | |
---|---|
SimReport(String name)
Creates a new report file. |
|
SimReport(String name,
int indent)
Creates a new report file. |
Method Summary | |
---|---|
void |
finalWrite()
Finalize the recording by writing all the previously given information into a file. |
void |
write(double num,
String desc)
Write the given data into the file. |
void |
write(int num,
String desc)
Write the given data into the file. |
void |
write(long num,
String desc)
Write the given data into the file. |
void |
write(String data)
Write the given data into the file. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int INDENT_SPACE
public static final int INDENT_COMMA
public static final int INDENT_TAB
Constructor Detail |
---|
public SimReport(String name) throws ParameterException
finalWrite()
before exiting to write the data into a file and close it.
Forgotten to call this method will result in not writing
into a file at all.
name
- file/entity name
ParameterException
- This happens when name is invalid or null.public SimReport(String name, int indent) throws ParameterException
finalWrite()
before exiting to write the data into a file and close it.
Forgotten to call this method will result in not writing
into a file at all.
name
- file/entity nameindent
- type of indentation (either a space, a comma or a tab)
ParameterException
- This happens when name is invalid or null.Method Detail |
---|
public void write(int num, String desc)
num
- integer numberdesc
- the description of this numberpublic void write(double num, String desc)
num
- decimal numberdesc
- the description of this numberpublic void write(long num, String desc)
num
- long numberdesc
- the description of this numberpublic void write(String data)
data
- data to be recordedpublic void finalWrite()
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |