parser.chocogen
Class XmlModel

java.lang.Object
  extended by parser.chocogen.XmlModel
Direct Known Subclasses:
XmlModelRPC

public class XmlModel
extends Object

User: charles Date: 19 août 2008

A class to provide facilities for loading and solving CSP described in the xml format of the 2008 competition


Field Summary
 int initialisationtime
           
static Logger LOGGER
           
 boolean randvalh
           
 
Constructor Summary
XmlModel()
           
 
Method Summary
 CPModel buildModel(InstanceParser parser)
          Building the Model and solver
static boolean checkEverythingIsInstantiated(InstanceParser parser, Solver s)
           
static void example()
          An example on how to use the xml parser-solver from the api
 void generate(String[] args)
          Main method.
static long getBuildTime()
           
static long getConfTime()
           
static long getFullTime()
           
 int getNbNodes()
           
static long getParseTime()
           
static long getResTime()
           
static String[] getValues()
           
 void init()
           
 Boolean isFeasible()
           
static InstanceParser load(File fichier)
          Parse the xml and return the parser object (Christophe parser) which can be used to access variables, constraints, etc...
static void main(String[] args)
           
 void postAnalyze(File fichier, InstanceParser parser, PreProcessCPSolver s)
          Output in the standart console a set of statistics on the search
 PreProcessCPSolver solve(CPModel model)
          Solving process
 void solveDirectory(File dossiers)
          Solve all the csps contained in the corresponding directory : dossiers
 void solveFile(File fichier)
          ei Solve the csp given by file "fichier"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

public static final Logger LOGGER

initialisationtime

public int initialisationtime

randvalh

public boolean randvalh
Constructor Detail

XmlModel

public XmlModel()
Method Detail

init

public void init()

generate

public void generate(String[] args)
              throws Exception
Main method. Check arguments and set up the options accordingly. example of command line : -file mycsp.xml -h 3 -ac 32 -s true -verb 1 -time 30

Parameters:
args - arguments
Throws:
Exception

solveFile

public void solveFile(File fichier)
ei Solve the csp given by file "fichier"

Parameters:
fichier -

solveDirectory

public void solveDirectory(File dossiers)
Solve all the csps contained in the corresponding directory : dossiers

Parameters:
dossiers - : the directory where instances are stored

load

public static InstanceParser load(File fichier)
                           throws Exception,
                                  Error
Parse the xml and return the parser object (Christophe parser) which can be used to access variables, constraints, etc...

Parameters:
fichier -
Returns:
A parser object containing the description of the problem
Throws:
Exception
Error

buildModel

public CPModel buildModel(InstanceParser parser)
                   throws Exception,
                          Error
Building the Model and solver

Parameters:
parser -
Returns:
Throws:
Exception
Error

solve

public PreProcessCPSolver solve(CPModel model)
                         throws Error
Solving process

Parameters:
model -
Returns:
Throws:
Exception
Error

postAnalyze

public void postAnalyze(File fichier,
                        InstanceParser parser,
                        PreProcessCPSolver s)
                 throws Error
Output in the standart console a set of statistics on the search

Parameters:
fichier -
parser -
s -
Throws:
Exception
Error

getParseTime

public static long getParseTime()

getBuildTime

public static long getBuildTime()

getConfTime

public static long getConfTime()

getResTime

public static long getResTime()

getFullTime

public static long getFullTime()

getNbNodes

public int getNbNodes()

isFeasible

public Boolean isFeasible()

getValues

public static String[] getValues()

checkEverythingIsInstantiated

public static boolean checkEverythingIsInstantiated(InstanceParser parser,
                                                    Solver s)

example

public static void example()
An example on how to use the xml parser-solver from the api


main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2012. All Rights Reserved.