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

Public Member Functions

 Meta (LevelSelection levelSelector)
 
Strategy getStrategy (Level level, int currentShot) throws IllegalArgumentException
 
void startMeta () throws InterruptedException, ServerException
 
void shutdown ()
 
boolean sceneInitialisationFailed (BufferedImage img, SceneInitialisationException e) throws ServerException
 
void shotSelected (Shot proposedShot, Plan plan, boolean demoShot)
 
void shotDelivered (Shot shot) throws ServerException
 
void shotDeliveredSceneStable (BufferedImage img, boolean moving, boolean noBirds, boolean noPigs) throws ServerException
 

Public Attributes

Plan lastPlan = null
 
String lastShotDescriptor = ""
 
boolean isPlaying = true
 

Static Public Attributes

static boolean EVALUATE_SHOTS = true
 

Private Member Functions

void selectNextLevel () throws ServerException
 
void selectNextLevel (Level level) throws ServerException
 
boolean shouldStartNextLevel ()
 
void evaluatePreviousShot (BufferedImage img) throws ServerException
 
boolean waitForLevelEnd () throws ServerException
 

Private Attributes

LevelSelection levelSelector
 
GameStateExtractor extractor
 
ShotExecutor shotExecutor = null
 
boolean levelInitialized = false
 
Level currentLevel = null
 
int previousScore = 0
 
int lastPigCount = 0
 
Shot lastShot = null
 

Static Private Attributes

static final Logger log = LogManager.getLogger(Meta.class)
 

Member Function Documentation

◆ evaluatePreviousShot()

void de.uniba.sme.bambirds.Meta.evaluatePreviousShot ( BufferedImage  img) throws ServerException
private

Calculate score difference to previous screen

Parameters
imgReusing screenshot from other analysis

◆ getStrategy()

Strategy de.uniba.sme.bambirds.Meta.getStrategy ( Level  level,
int  currentShot 
) throws IllegalArgumentException

Callback method for prolog file generation

Parameters
level
Returns
Exceptions
IllegalArgumentException

Implements de.uniba.sme.bambirds.execution.ShotExecutor.StrategyCallback.

◆ sceneInitialisationFailed()

boolean de.uniba.sme.bambirds.Meta.sceneInitialisationFailed ( BufferedImage  img,
SceneInitialisationException  e 
) throws ServerException
Returns
Return value for ShotExecutor#run(BufferedImage) command
Exceptions
ServerException

Implements de.uniba.sme.bambirds.execution.ShotExecutor.ShotExecutorCallback.

◆ selectNextLevel()

void de.uniba.sme.bambirds.Meta.selectNextLevel ( Level  level) throws ServerException
private

Tell server to load a different level and update current level object

◆ shotDelivered()

void de.uniba.sme.bambirds.Meta.shotDelivered ( Shot  shot) throws ServerException

Evaluated predicted parabola with actual and update decision tree

Exceptions
ServerException

Implements de.uniba.sme.bambirds.execution.ShotExecutor.ShotExecutorCallback.

◆ shotDeliveredSceneStable()

void de.uniba.sme.bambirds.Meta.shotDeliveredSceneStable ( BufferedImage  img,
boolean  moving,
boolean  noBirds,
boolean  noPigs 
) throws ServerException

Will be called after everything has come to a still (max 16s)

Parameters
movingHard limit exceeded
Exceptions
ServerException

Implements de.uniba.sme.bambirds.execution.ShotExecutor.ShotExecutorCallback.

◆ shotSelected()

void de.uniba.sme.bambirds.Meta.shotSelected ( Shot  proposedShot,
Plan  plan,
boolean  demoShot 
)

◆ shouldStartNextLevel()

boolean de.uniba.sme.bambirds.Meta.shouldStartNextLevel ( )
private
Returns
Returns true if Meta has just initialised or
shotCount > 10

◆ waitForLevelEnd()

boolean de.uniba.sme.bambirds.Meta.waitForLevelEnd ( ) throws ServerException
private
Returns
false if timeout exceeded
Exceptions
ServerException

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