AERA
Public Member Functions | Public Attributes | List of all members
r_exec::Pred Class Reference
Inheritance diagram for r_exec::Pred:
r_exec::LObject r_exec::Object< r_code::LocalObject, LObject > r_code::LocalObject r_code::Code core::_Object

Public Member Functions

 Pred (r_code::SysObject *source)
 
 Pred (_Fact *target, const std::vector< P< Sim > > &simulations, float32 psln_thr)
 
 Pred (_Fact *target, float32 psln_thr)
 
 Pred (_Fact *target, Sim *sim, float32 psln_thr)
 
 Pred (_Fact *target, const Pred *simulations_source, float32 psln_thr)
 
bool is_invalidated () override
 
bool grounds_invalidated (_Fact *evidence)
 
_Factget_target () const
 
bool is_simulation () const
 
uint16 get_simulations_size () const
 
Simget_simulation (uint16 i) const
 
Simget_simulation (Controller *root) const
 
bool has_simulation (Sim *sim) const
 
bool has_defeasible_consequence () const
 
DefeasibleValidityget_defeasible_consequence ()
 
- Public Member Functions inherited from r_exec::LObject
 LObject (r_code::Mem *mem=NULL)
 
 LObject (r_code::SysObject *source)
 
- Public Member Functions inherited from r_exec::Object< r_code::LocalObject, LObject >
r_code::_Viewbuild_view (r_code::SysView *source) override
 
bool is_invalidated () override
 
bool invalidate () override
 
void compute_hash_value ()
 
float32 get_psln_thr () override
 
void acq_views () override
 
void rel_views () override
 
void acq_markers () override
 
void rel_markers () override
 
void set (uint16 member_index, float32 value) override
 
void mod (uint16 member_index, float32 value) override
 
r_code::_Viewget_view (r_code::Code *group, bool lock) override
 
- Public Member Functions inherited from r_code::LocalObject
 LocalObject (SysObject *source)
 
uint32 get_oid () const override
 
void set_oid (uint32 oid) override
 
Atomcode (uint16 i) override
 
const Atomcode (uint16 i) const override
 
uint16 code_size () const override
 
void resize_code (uint16 new_size) override
 
void set_reference (uint16 i, Code *object) override
 
Codeget_reference (uint16 i) const override
 
uint16 references_size () const override
 
void clear_references () override
 
void set_references (std::vector< P< Code > > &new_references) override
 
void add_reference (Code *object) override
 
- Public Member Functions inherited from r_code::Code
void set_strorage_index (int32 i)
 
bool is_registered () const
 
int32 get_storage_index () const
 
bool includes (Atom a) const
 
virtual bool is_compact () const
 
virtual void mod (uint16, float32)
 
virtual void set (uint16, float32)
 
void remove_marker (Code *m)
 
void trace (uint16 i, std::ostream &out, Atom::TraceContext &context) const
 
void trace (std::ostream &out) const
 
void trace () const
 
std::string trace_string () const
 
std::string trace_string (uint16 i) const
 
void r_trace (std::ostream &out) const
 
void r_trace () const
 
std::string r_trace_string () const
 
- Public Member Functions inherited from core::_Object
void incRef ()
 
virtual void decRef ()
 

Public Attributes

std::vector< P< _Fact > > grounds_
 
std::set< P< DefeasibleValidity > > defeasible_validities_
 
bool is_promoted_
 
- Public Attributes inherited from r_code::Code
r_code::list< Code * > markers_
 
std::unordered_set< _View *, _View::Hash, _View::Equalviews_
 

Additional Inherited Members

- Static Public Member Functions inherited from r_exec::LObject
static bool RequiresPacking ()
 
static LObjectPack (r_code::Code *object, r_code::Mem *)
 
- Static Public Attributes inherited from r_code::Code
static const int32 null_storage_index = -1
 
static const uint32 CodeMarkersInitialSize = 8
 
- Protected Member Functions inherited from r_exec::Object< r_code::LocalObject, LObject >
 Object (r_code::Mem *mem)
 
- Protected Member Functions inherited from r_code::Code
void load (SysObject *source)
 
template<class V >
_Viewbuild_view (SysView *source)
 
- Protected Attributes inherited from r_code::Code
int32 storage_index_
 
- Protected Attributes inherited from core::_Object
std::atomic_int32_t refCount_
 

Detailed Description

Definition at line 393 of file factory.h.

Constructor & Destructor Documentation

◆ Pred() [1/4]

r_exec::Pred::Pred ( _Fact target,
const std::vector< P< Sim > > &  simulations,
float32  psln_thr 
)
inline

Create a Pred with the given values.

Parameters
targetThe prediction target.
simulationsCopy the list of simulations.
psln_thrThe propagation of saliency threshold.

Definition at line 404 of file factory.h.

◆ Pred() [2/4]

r_exec::Pred::Pred ( _Fact target,
float32  psln_thr 
)
inline

Create a Pred with the given values and no simulations.

Parameters
targetThe prediction target.
psln_thrThe propagation of saliency threshold.

Definition at line 412 of file factory.h.

◆ Pred() [3/4]

r_exec::Pred::Pred ( _Fact target,
Sim sim,
float32  psln_thr 
)
inline

Create a Pred with the given values.

Parameters
targetThe prediction target.
simThe one simulation for the list of simulations.
psln_thrThe propagation of saliency threshold.

Definition at line 421 of file factory.h.

◆ Pred() [4/4]

r_exec::Pred::Pred ( _Fact target,
const Pred simulations_source,
float32  psln_thr 
)

Create a Pred with the given values.

Parameters
targetThe prediction target.
simulations_sourceThe Pred with the list of simulations to copy. This also copies the set of DefeasibleValidity from simulations_source to the new Pred.
psln_thrThe propagation of saliency threshold.

Definition at line 550 of file factory.cpp.

Member Function Documentation

◆ get_defeasible_consequence()

DefeasibleValidity* r_exec::Pred::get_defeasible_consequence ( )
inline

Get this Pred's defeasible consequence, creating one if it doesn't already exist. If you don't want to create a defeasible consequence , check has_defeasible_consequence() first.

Returns
This Pred's defeasible_consequence_.

Definition at line 499 of file factory.h.

◆ get_simulation() [1/2]

Sim * r_exec::Pred::get_simulation ( Controller root) const

Get the first simulation whose root is the given root Controller.

Parameters
rootThe root Controller to search for.
Returns
The first simulation with the root, or NULL if not found.

Definition at line 626 of file factory.cpp.

◆ get_simulation() [2/2]

Sim* r_exec::Pred::get_simulation ( uint16  i) const
inline

Get the simulation in the list of simulations at index i.

Parameters
iThe index of the simulation, from 0 to get_simulations_size() - 1.
Returns
The simulation at index i.

Definition at line 468 of file factory.h.

◆ get_simulations_size()

uint16 r_exec::Pred::get_simulations_size ( ) const
inline

Get the size of the list of simulations.

Returns
The size of the list of simulations.

Definition at line 458 of file factory.h.

◆ has_defeasible_consequence()

bool r_exec::Pred::has_defeasible_consequence ( ) const
inline

Check if this Pred has a defeasible consequence.

Returns
True if this has a defeasible consequence.

Definition at line 492 of file factory.h.

◆ has_simulation()

bool r_exec::Pred::has_simulation ( Sim sim) const

Check if the list of simulations has the given sim.

Parameters
simThe Sim to check for.
Returns
True if the list of simulations has sim.

Definition at line 638 of file factory.cpp.

◆ is_invalidated()

bool r_exec::Pred::is_invalidated ( )
overridevirtual

Check if this Pred is invalidated and also recursively call is_invalidated() for the target of this Pred and the list of simulations, grounds and defeasible validities. If any is invalidated then call invalidate() and return true.

Returns
true if this is invalidated.

Reimplemented from r_code::Code.

Definition at line 576 of file factory.cpp.


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