TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Public Member Functions | Protected Attributes | List of all members
cherrypi::movefilters::FuncPositionFilter< T, Container > Class Template Reference

Input: More...

#include <movefilters.h>

Inherits cherrypi::movefilters::PositionFilter.

Public Member Functions

 FuncPositionFilter (std::function< Container const &&(Unit *)> getter, std::function< bool(Unit *, Position const &, T)> valid, std::function< float(Unit *, Position const &, T)> scoreFunc, PositionFilterPolicy policy=PositionFilterPolicy::ACCEPT_IF_ALL, bool blocking=false)
 
bool isValid (Unit *agent, Position const &pos) override
 
float score (Unit *agent, Position const &pos) override
 
bool blocking () override
 
- Public Member Functions inherited from cherrypi::movefilters::PositionFilter
virtual ~PositionFilter ()=default
 

Protected Attributes

std::function< Container const &&(Unit *)> getter_
 
std::function< bool(Unit *, Position const &, T)> valid_
 
std::function< float(Unit *, Position const &, T)> score_
 
PositionFilterPolicy policy_
 
bool blocking_
 

Detailed Description

template<typename T, typename Container>
class cherrypi::movefilters::FuncPositionFilter< T, Container >

Input:

The filter will decide if a position is valid by combining the valid func and score function according to the PositionFilterPolicy.

Constructor & Destructor Documentation

template<typename T , typename Container >
cherrypi::movefilters::FuncPositionFilter< T, Container >::FuncPositionFilter ( std::function< Container const &&(Unit *)>  getter,
std::function< bool(Unit *, Position const &, T)>  valid,
std::function< float(Unit *, Position const &, T)>  scoreFunc,
PositionFilterPolicy  policy = PositionFilterPolicy::ACCEPT_IF_ALL,
bool  blocking = false 
)
inline

Member Function Documentation

template<typename T , typename Container >
bool cherrypi::movefilters::FuncPositionFilter< T, Container >::blocking ( )
inlineoverridevirtual
template<typename T , typename Container >
bool cherrypi::movefilters::FuncPositionFilter< T, Container >::isValid ( Unit agent,
Position const &  pos 
)
inlineoverridevirtual
template<typename T , typename Container >
float cherrypi::movefilters::FuncPositionFilter< T, Container >::score ( Unit agent,
Position const &  pos 
)
inlineoverridevirtual

Member Data Documentation

template<typename T , typename Container >
bool cherrypi::movefilters::FuncPositionFilter< T, Container >::blocking_
protected
template<typename T , typename Container >
std::function<Container const && (Unit*)> cherrypi::movefilters::FuncPositionFilter< T, Container >::getter_
protected
template<typename T , typename Container >
PositionFilterPolicy cherrypi::movefilters::FuncPositionFilter< T, Container >::policy_
protected
template<typename T , typename Container >
std::function<float(Unit*, Position const&, T)> cherrypi::movefilters::FuncPositionFilter< T, Container >::score_
protected
template<typename T , typename Container >
std::function<bool(Unit*, Position const&, T)> cherrypi::movefilters::FuncPositionFilter< T, Container >::valid_
protected

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