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

Classes

class  DefeasiblePromotedFact
 

Public Member Functions

 Sim (Sim *s)
 
 Sim (SimMode mode, std::chrono::microseconds thz, Fact *super_goal, bool opposite, Controller *root, float32 psln_thr, Controller *solution_controller=NULL, float32 solution_cfd=0, Timestamp solution_before=r_code::Utils::GetTimeReference())
 
bool invalidate () override
 
bool is_invalidated () override
 
SimMode get_mode () const
 
std::chrono::microseconds get_thz () const
 
Factget_f_super_goal () const
 
bool get_opposite () const
 
float32 get_solution_cfd () const
 
Timestamp get_solution_before () const
 
void set_solution_before (Timestamp before)
 
Simget_root_sim ()
 
bool register_goal_target (_Fact *f_obj)
 
- 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

bool is_requirement_
 
P< Controllerroot_
 
P< Controllersolution_controller_
 
CriticalSectionList< DefeasiblePromotedFactdefeasible_promoted_facts_
 
r_code::list< P< _Fact > > defeating_facts_
 
std::vector< P< _Fact > > already_signalled_
 
- 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 247 of file factory.h.

Member Function Documentation

◆ get_f_super_goal()

Fact* r_exec::Sim::get_f_super_goal ( ) const
inline

Get the (fact of the) super goal of the goal the sim is attached to.

Definition at line 266 of file factory.h.

◆ get_opposite()

bool r_exec::Sim::get_opposite ( ) const
inline

Get the opposite flag of the goal the sim is attached to, i.e. the result of the match during controller->reduce(); the confidence is in the goal target.

Definition at line 272 of file factory.h.

◆ get_root_sim()

Sim * r_exec::Sim::get_root_sim ( )

Recursively search this or parent Sim objects to get the Sim object where get_mode() == SIM_ROOT.

Returns
The root Sim object, or NULL if not found (which shouldn't happen).

Definition at line 771 of file factory.cpp.

◆ get_solution_before()

Timestamp r_exec::Sim::get_solution_before ( ) const
inline

Get the deadline of the solution goal.

Definition at line 282 of file factory.h.

◆ get_solution_cfd()

float32 r_exec::Sim::get_solution_cfd ( ) const
inline

Get the confidence of the solution goal.

Definition at line 277 of file factory.h.

◆ register_goal_target()

bool r_exec::Sim::register_goal_target ( _Fact f_obj)

If f_obj does not match any of the goal targets stored in the root Sim object, then store it in the root Sim object for future checks and return true. (In this case, you should inject it as a goal.) Otherwise if the goal target was already registered then return false, meaning that it does not need to be made into a goal again.

Parameters
f_objThe (fact of the) object, such as (fact (mk_val ...)).
Returns
True if f_obj has been registered and should be injected as a goal, false if it is already registered and should not be injected as a goal.

Definition at line 785 of file factory.cpp.

◆ set_solution_before()

void r_exec::Sim::set_solution_before ( Timestamp  before)
inline

Set the deadline of the solution goal.

Definition at line 287 of file factory.h.


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