org.dbe.eve.simulator
Class ModelSerialization

java.lang.Object
  extended by org.dbe.eve.simulator.ModelSerialization

public class ModelSerialization
extends java.lang.Object

The ModelSerialization has some static methods to store and load model data

Author:
Roman Greil

Field Summary
(package private) static org.apache.log4j.Logger logger
           
 
Constructor Summary
ModelSerialization()
           
 
Method Summary
static void addRelationshipsFromCSV(SMERelationships srs, java.lang.String path)
          Gets all relationsships from a CSV file
static boolean loadModelFromCSV(EvEModel model)
          loads data from one or more csv files into the model
static boolean loadModelFromXML(EvEModel model)
          shows a file open dialog. if a file is selected the readXMLFile method is called
static void loadParametersFromXML(EvEModel model)
          Load model parameters from xml file
static void main(java.lang.String[] args)
          To test the findNewFriend algorithm
static SMERelationships readCSVFiles(java.io.File[] fileList)
          Returns all SME relationships from all files in the list
static boolean readXMLFile(EvEModel model, java.io.File file)
          loads data from a xml file into the model
static boolean saveModelToXML(EvEModel model)
          Stores all information from the model to a XML file
static void saveParametersToXML(EvEModel model)
          Stores all parameters from the model to a xml file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
Constructor Detail

ModelSerialization

public ModelSerialization()
Method Detail

loadModelFromCSV

public static boolean loadModelFromCSV(EvEModel model)
loads data from one or more csv files into the model

Parameters:
model - a repast model
Returns:
true or false

loadParametersFromXML

public static void loadParametersFromXML(EvEModel model)
Load model parameters from xml file


saveParametersToXML

public static void saveParametersToXML(EvEModel model)
Stores all parameters from the model to a xml file

Parameters:
model - the model

loadModelFromXML

public static boolean loadModelFromXML(EvEModel model)
shows a file open dialog. if a file is selected the readXMLFile method is called

Parameters:
model - a repast model
Returns:
true or false

saveModelToXML

public static boolean saveModelToXML(EvEModel model)
Stores all information from the model to a XML file

Parameters:
model - the model
Returns:
true if saving was successful

addRelationshipsFromCSV

public static void addRelationshipsFromCSV(SMERelationships srs,
                                           java.lang.String path)
Gets all relationsships from a CSV file

Parameters:
srs - the SMERelationships where the new relations should be added
path - the path of the file

readCSVFiles

public static SMERelationships readCSVFiles(java.io.File[] fileList)
Returns all SME relationships from all files in the list

Parameters:
fileList - a list of CSV files
Returns:
SMERelationships that includes all relations

readXMLFile

public static boolean readXMLFile(EvEModel model,
                                  java.io.File file)
loads data from a xml file into the model

Parameters:
model - a repast model
Returns:
true if the loading was successful

main

public static void main(java.lang.String[] args)
To test the findNewFriend algorithm

Parameters:
args - nothing required