BamBirds 2021
de.uniba.sme.bambirds.planner.PrologPlanner Class Reference
Inheritance diagram for de.uniba.sme.bambirds.planner.PrologPlanner:
Collaboration diagram for de.uniba.sme.bambirds.planner.PrologPlanner:

Public Member Functions

 PrologPlanner (Level level, String basename, PrologPlanParser parser)
 
 PrologPlanner (String knowledgeBaseFilename, PrologPlanParser parser)
 
 PrologPlanner (SWIConnector connector, String knowledgeBaseFilename, PlanParser parser)
 
void plan (StrategyConsumer consumer, long timeOut)
 
List< PlanplanSynchronously (long timeOut)
 
void kill ()
 
boolean isCancelled ()
 
boolean isFinished ()
 

Static Public Member Functions

static void compileExecutable ()
 

Private Member Functions

void startSWIConnector (SWIConnector connector)
 

Private Attributes

final SWIConnector connector
 
Thread connectorThread
 
final String knowledgeBaseFilename
 
final PlanParser parser
 
boolean finished = false
 
boolean cancelled = false
 

Static Private Attributes

static final Logger log = LogManager.getLogger()
 

Constructor & Destructor Documentation

◆ PrologPlanner() [1/3]

de.uniba.sme.bambirds.planner.PrologPlanner.PrologPlanner ( Level  level,
String  basename,
PrologPlanParser  parser 
)

Create a new PrologPlanner including a knowledge base and connector to Prolog

Parameters
levelfor which the model should be built
basenamebase name for the knowledge file
parsera Parser for Prolog targets

◆ PrologPlanner() [2/3]

de.uniba.sme.bambirds.planner.PrologPlanner.PrologPlanner ( String  knowledgeBaseFilename,
PrologPlanParser  parser 
)

Create a new PrologPlanner including a connector to Prolog given an existing knowledge base

Parameters
knowledgeBaseFilenamePath to the knowledge base
parsera Parser for Prolog targets

◆ PrologPlanner() [3/3]

de.uniba.sme.bambirds.planner.PrologPlanner.PrologPlanner ( SWIConnector  connector,
String  knowledgeBaseFilename,
PlanParser  parser 
)

Create a new PrologPlanner using the given connector to Prolog and existing knowledge base

Parameters
connectorConnector to Prolog
knowledgeBaseFilenamePath to the knowledge base
parsera Parser for Prolog targets

Member Function Documentation

◆ isCancelled()

boolean de.uniba.sme.bambirds.planner.PrologPlanner.isCancelled ( )

Returns

true

if this strategy was cancelled before it completed normally.

Returns
true
if this strategy was cancelled before it completed

Implements de.uniba.sme.bambirds.common.Strategy.

◆ kill()

void de.uniba.sme.bambirds.planner.PrologPlanner.kill ( )

Kill the

Strategy

, i.e. tell it to stop planning and shut down.

Implements de.uniba.sme.bambirds.common.Strategy.

◆ plan()

void de.uniba.sme.bambirds.planner.PrologPlanner.plan ( StrategyConsumer  consumer,
long  timeOut 
)

Start the

Strategy

's planning. The

Strategy

will call StrategyConsumer#post(List) or StrategyConsumer#post(Plan) to submit its plans. The planning should finish within

timeOut

milliseconds, after that it may be stopped.

Ideally individual plans are submitted to

consumer

as soon as they are found and planning is stopped after

timeOut

.

Parameters
consumerThe StrategyConsumer instance whose
post
method will be used for the callback
timeOutThe maximum amount of time available for planning in milliseconds

Implements de.uniba.sme.bambirds.common.Strategy.

◆ planSynchronously()

List< Plan > de.uniba.sme.bambirds.planner.PrologPlanner.planSynchronously ( long  timeOut)

Start the

Strategy

's planning. The

Strategy

will return all found Targets. The planning should finish within

timeOut

milliseconds, after that it will be stopped and if the Strategy supports it unfiltered plans are then returned.

Parameters
timeOutThe maximum amount of time available for planning in milliseconds

Implements de.uniba.sme.bambirds.common.Strategy.


The documentation for this class was generated from the following file: