|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectparser.instances.AbstractInstanceModel
public abstract class AbstractInstanceModel
A class to provide facilities for loading and solving instance described by a file (txt, xml, ...).
Field Summary | |
---|---|
protected DbManager |
dbManager
|
protected Configuration |
defaultConf
|
static Logger |
LOGGER
|
protected ReportFormatter |
logMsg
|
protected Model |
model
|
protected Number |
objective
|
protected InstanceFileParser |
parser
|
protected Solver |
solver
|
Constructor Summary | |
---|---|
AbstractInstanceModel(InstanceFileParser parser,
Configuration defaultConfiguration)
|
Method Summary | |
---|---|
boolean |
applyCP()
|
abstract Model |
buildModel()
create the choco model after the preprocessing phase. |
abstract Solver |
buildSolver()
create a solver from the current model |
protected void |
checkIsSatisfied()
|
void |
checkSolution()
The method checks the validity of the solution. |
protected void |
checkStatus()
|
void |
consoleReport()
the default console report as described in http://www.cril.univ-artois.fr/CPAI09/call2009/call2009.html#SECTION00080000000000000000 |
void |
databaseReport()
connect to a embedded, local or remote database and add an entry associated with the current resolution. |
long |
getBuildTime()
|
Configuration |
getConfiguration()
|
long |
getConfTime()
|
DbManager |
getDatabaseManager()
|
double |
getFullSecTime()
|
long |
getFullTime()
|
Number |
getInitialObjectiveValue()
|
String |
getInstanceName()
|
Model |
getModel()
|
Number |
getObjectiveValue()
|
File |
getOutputDirectory()
|
InstanceFileParser |
getParser()
|
long |
getParseTime()
|
long |
getPreProcTime()
|
long |
getResTime()
|
long |
getSeed()
|
Solver |
getSolver()
|
ResolutionStatus |
getStatus()
|
String |
getValuesMessage()
|
void |
initialize()
|
boolean |
isDatabaseReporting()
|
Boolean |
isFeasible()
|
void |
load(File fichier)
Parse the xml and return the parser object (Christophe parser) which can be used to access variables, constraints, etc... |
protected void |
logOnConfiguration()
|
protected void |
logOnDiagnostics()
|
void |
makeReports()
|
ResolutionStatus |
postAnalyzeCP()
compute the resolution status after the cp search (solver is not null). |
ResolutionStatus |
postAnalyzePP()
compute the resolution status after the preprocessing stage (no solver build yet). |
abstract Boolean |
preprocess()
Executes preprocessing ( bounding, heuristics ...) |
void |
setDatabaseManager(DbManager dbManager)
|
protected void |
setObjective(Number objective)
|
abstract Boolean |
solve()
configure and launch the resolution. |
void |
solveFile(File file)
Solve the csp given by file file |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Logger LOGGER
protected Number objective
protected final InstanceFileParser parser
protected Model model
protected Solver solver
protected DbManager dbManager
protected final Configuration defaultConf
protected final ReportFormatter logMsg
Constructor Detail |
---|
public AbstractInstanceModel(InstanceFileParser parser, Configuration defaultConfiguration)
Method Detail |
---|
public final Configuration getConfiguration()
public String getInstanceName()
public void initialize()
public final Boolean isFeasible()
public final ResolutionStatus getStatus()
public final Number getInitialObjectiveValue()
public final Number getObjectiveValue()
public final File getOutputDirectory()
public final long getSeed()
public final boolean isDatabaseReporting()
public final DbManager getDatabaseManager()
public final void setDatabaseManager(DbManager dbManager)
public final InstanceFileParser getParser()
public final Model getModel()
public final Solver getSolver()
protected final void setObjective(Number objective)
public final void solveFile(File file)
file
file
- instance file to solvepublic void load(File fichier) throws UnsupportedConstraintException
fichier
-
Exception
Error
UnsupportedConstraintException
public abstract Boolean preprocess()
true
if a solution has been found, false
if the infeasibility has been proven and null
otherwise.public abstract Model buildModel()
public abstract Solver buildSolver()
public abstract Boolean solve()
protected final void checkIsSatisfied() throws SolutionCheckerException
SolutionCheckerException
protected final void checkStatus() throws SolutionCheckerException
SolutionCheckerException
public void checkSolution() throws SolutionCheckerException
SolutionCheckerException
public ResolutionStatus postAnalyzePP()
public boolean applyCP()
public ResolutionStatus postAnalyzeCP()
protected void logOnDiagnostics()
protected void logOnConfiguration()
public void makeReports()
public void consoleReport()
public void databaseReport()
public String getValuesMessage()
public final long getParseTime()
public final long getPreProcTime()
public final long getBuildTime()
public final long getConfTime()
public final long getResTime()
public final long getFullTime()
public final double getFullSecTime()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |