AERA
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
r_exec::_Mem Class Referenceabstract

#include <mem.h>

Inheritance diagram for r_exec::_Mem:
r_code::Mem r_exec::MemStatic r_exec::MemVolatile

Public Types

enum  State { NOT_STARTED = 0, RUNNING = 1, STOPPED = 2 }
 
enum  STDGroupID { STDIN = 0, STDOUT = 1 }
 

Public Member Functions

void init (std::chrono::microseconds base_period, uint32 reduction_core_count, uint32 time_core_count, float32 mdl_inertia_sr_thr, uint32 mdl_inertia_cnt_thr, float32 tpx_dsr_thr, std::chrono::microseconds min_sim_time_horizon, std::chrono::microseconds max_sim_time_horizon, float32 sim_time_horizon_factor, std::chrono::microseconds tpx_time_horizon, std::chrono::microseconds perf_sampling_period, float32 float_tolerance, std::chrono::microseconds time_tolerance, std::chrono::microseconds primary_thz, std::chrono::microseconds secondary_thz, bool debug, uint32 ntf_mk_res, uint32 goal_pred_success_res, uint32 probe_level, uint32 traces, bool keep_invalidated_objects)
 
State get_state () const
 
std::chrono::microseconds get_sampling_period () const
 
uint64 get_probe_level () const
 
uint32 get_reduction_core_count () const
 
uint32 get_time_core_count () const
 
float32 get_mdl_inertia_sr_thr () const
 
uint32 get_mdl_inertia_cnt_thr () const
 
float32 get_tpx_dsr_thr () const
 
std::chrono::microseconds get_min_sim_time_horizon () const
 
std::chrono::microseconds get_max_sim_time_horizon () const
 
std::chrono::microseconds get_sim_time_horizon (std::chrono::microseconds horizon) const
 
std::chrono::microseconds get_tpx_time_horizon () const
 
std::chrono::microseconds get_primary_thz () const
 
std::chrono::microseconds get_secondary_thz () const
 
bool get_debug () const
 
uint32 get_ntf_mk_res () const
 
uint32 get_goal_pred_success_res (Group *host, Timestamp now, Timestamp::duration time_to_live) const
 
r_code::Codeget_root () const
 
r_code::Codeget_stdin () const
 
r_code::Codeget_stdout () const
 
r_code::Codeget_self () const
 
State check_state ()
 
void start_core ()
 
void shutdown_core ()
 
virtual bool load (const std::vector< r_code::Code * > *objects, uint32 stdin_oid, uint32 stdout_oid, uint32 self_oid)
 
Timestamp start ()
 
void run_in_diagnostic_time (std::chrono::milliseconds run_time)
 
virtual void on_diagnostic_time_tick ()
 
void stop ()
 
P< _ReductionJobpop_reduction_job (bool waitForItem=true)
 
void push_reduction_job (_ReductionJob *j)
 
P< TimeJobpop_time_job (bool waitForItem=true)
 
void push_time_job (TimeJob *j)
 
void inject_from_io_device (View *view)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, Atom val, Timestamp after, Timestamp before, View::SyncMode sync_mode, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, std::vector< Atom > val, Timestamp after, Timestamp before, View::SyncMode sync_mode, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, Atom val, Timestamp after, Timestamp before, View::SyncMode sync_mode)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, Atom val, Timestamp after, Timestamp before, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, Atom val, Timestamp after, Timestamp before)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, r_code::Code *val, Timestamp after, Timestamp before, View::SyncMode sync_mode, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, r_code::Code *val, Timestamp after, Timestamp before, View::SyncMode sync_mode)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, r_code::Code *val, Timestamp after, Timestamp before, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, r_code::Code *val, Timestamp after, Timestamp before)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, const std::string &val, Timestamp after, Timestamp before, View::SyncMode sync_mode, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, const std::string &val, Timestamp after, Timestamp before, View::SyncMode sync_mode)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, const std::string &val, Timestamp after, Timestamp before, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, const std::string &val, Timestamp after, Timestamp before)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, const std::vector< r_code::Code * > &val, Timestamp after, Timestamp before, View::SyncMode sync_mode, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, const std::vector< r_code::Code * > &val, Timestamp after, Timestamp before, View::SyncMode sync_mode)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, const std::vector< r_code::Code * > &val, Timestamp after, Timestamp before, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, const std::vector< r_code::Code * > &val, Timestamp after, Timestamp before)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, uint16 opcode, const std::vector< r_code::Atom > &vals, Timestamp after, Timestamp before, View::SyncMode sync_mode, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, uint16 opcode, const std::vector< r_code::Atom > &vals, Timestamp after, Timestamp before, View::SyncMode sync_mode)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, uint16 opcode, const std::vector< r_code::Atom > &vals, Timestamp after, Timestamp before, r_code::Code *group)
 
Viewinject_marker_value_from_io_device (r_code::Code *obj, r_code::Code *prop, uint16 opcode, const std::vector< r_code::Atom > &vals, Timestamp after, Timestamp before)
 
Viewinject_fact_from_io_device (r_code::Code *object, Timestamp after, Timestamp before, View::SyncMode sync_mode, r_code::Code *group)
 
Viewinject_fact_from_io_device (r_code::Code *object, Timestamp after, Timestamp before, r_code::Code *group)
 
void inject (View *view, bool is_from_io_device=false)
 
void inject_async (View *view)
 
void inject_new_object (View *view)
 
void inject_existing_object (View *view, r_code::Code *object, Group *host)
 
void inject_null_program (Controller *c, Group *group, std::chrono::microseconds time_to_live, bool take_past_inputs)
 
void inject_hlps (std::vector< View * > views, Group *destination)
 
void inject_notification (View *view, bool lock)
 
virtual r_code::Codecheck_existence (r_code::Code *object)=0
 
void propagate_sln (r_code::Code *object, float32 change, float32 source_sln_thr)
 
void inject_copy (View *view, Group *destination)
 
void register_reduction_job_latency (std::chrono::microseconds latency)
 
void register_time_job_latency (std::chrono::microseconds latency)
 
void inject_perf_stats ()
 
virtual void eject (View *view, uint16 node_id)
 
virtual r_code::Codeeject (r_code::Code *command)
 
virtual r_code::Code_build_object (Atom head) const =0
 
virtual r_code::Codebuild_object (Atom head) const =0
 
void pack_hlp (r_code::Code *hlp) const
 
r_code::Codeclone (r_code::Code *original) const
 
virtual r_comp::Imageget_objects (bool include_invalidated=false)=0
 
r_comp::Imageget_models ()
 
bool matches_axiom (r_code::Code *obj)
 
void set_default_runtime_output_stream (std::ostream *default_runtime_output_stream)
 
- Public Member Functions inherited from r_code::Mem
virtual Codebuild_object (SysObject *source) const =0
 
virtual void delete_object (Code *object)=0
 

Static Public Member Functions

static _MemGet ()
 
static Timestamp get_diagnostic_time_now ()
 
static void unpack_hlp (r_code::Code *hlp)
 
static r_code::Codeunpack_fact (r_code::Code *hlp, uint16 fact_index)
 
static r_code::Codeunpack_fact_object (r_code::Code *hlp, uint16 fact_object_index)
 
static void pack_fact (r_code::Code *fact, r_code::Code *hlp, uint16 &write_index, std::vector< P< r_code::Code > > *references)
 
static void pack_fact_object (r_code::Code *fact_object, r_code::Code *hlp, uint16 &write_index, std::vector< P< r_code::Code > > *references)
 
static r_code::Codefind_object (const std::vector< r_code::Code * > *objects, const char *name)
 
static void init_timestamps (Timestamp time_reference, const r_code::list< P< r_code::Code >> &objects)
 
static std::ostream & Output (TraceLevel l)
 
- Static Public Member Functions inherited from r_code::Mem
static MemGet ()
 

Static Public Attributes

static Timestamp diagnostic_time_now_ = Timestamp(microseconds(1))
 

Protected Member Functions

void reset ()
 
void store (r_code::Code *object)
 
virtual void set_last_oid (int32 oid)=0
 
virtual void bind (View *view)=0
 

Static Protected Member Functions

static void _unpack_code (r_code::Code *hlp, uint16 fact_object_index, r_code::Code *fact_object, uint16 read_index)
 

Protected Attributes

std::chrono::microseconds base_period_
 
uint32 reduction_core_count_
 
uint32 time_core_count_
 
float32 mdl_inertia_sr_thr_
 
uint32 mdl_inertia_cnt_thr_
 
float32 tpx_dsr_thr_
 
std::chrono::microseconds min_sim_time_horizon_
 
std::chrono::microseconds max_sim_time_horizon_
 
float32 sim_time_horizon_factor_
 
std::chrono::microseconds tpx_time_horizon_
 
std::chrono::microseconds perf_sampling_period_
 
float32 float_tolerance_
 
std::chrono::microseconds time_tolerance_
 
std::chrono::microseconds primary_thz_
 
std::chrono::microseconds secondary_thz_
 
bool debug_
 
uint32 ntf_mk_res_
 
uint32 goal_pred_success_res_
 
bool keep_invalidated_objects_
 
uint32 probe_level_
 
PipeNN< P< _ReductionJob >, 1024 > * reduction_job_queue_
 
PipeNN< P< TimeJob >, 1024 > * time_job_queue_
 
ReductionCore ** reduction_cores_
 
TimeCore ** time_cores_
 
uint32 reduction_job_count_
 
std::chrono::microseconds reduction_job_avg_latency_
 
std::chrono::microseconds _reduction_job_avg_latency_
 
uint32 time_job_count_
 
std::chrono::microseconds time_job_avg_latency_
 
std::chrono::microseconds _time_job_avg_latency_
 
CriticalSection time_jobCS_
 
CriticalSection reduction_jobCS_
 
uint32 core_count_
 
CriticalSection core_countCS_
 
State state_
 
CriticalSection stateCS_
 
Semaphorestop_sem_
 
r_code::list< P< r_code::Code > > objects_
 
P< Grouproot_
 
r_code::Codestdin_
 
r_code::Codestdout_
 
r_code::Codeself_
 
std::vector< Group * > initial_groups_
 
bool deleted_
 
std::ostream * runtime_output_streams_ [RUNTIME_OUTPUT_STREAM_COUNT]
 
std::ostream * default_runtime_output_stream_
 
std::vector< P< r_code::Code > > axiom_values_
 

Static Protected Attributes

static const uint32 RUNTIME_OUTPUT_STREAM_COUNT = 10
 
- Static Protected Attributes inherited from r_code::Mem
static Memsingleton_ = NULL
 

Detailed Description

The rMem. Maintains 2 pipes of jobs (injection, update, etc.). each job is processed asynchronously by instances of ReductionCore and TimeCore. Pipes and threads are created at starting time and deleted at stopping time. Groups and IPGMControllers are cleared up when only held by jobs;

Definition at line 117 of file mem.h.

Member Function Documentation

◆ eject()

r_code::Code * r_exec::_Mem::eject ( r_code::Code command)
virtual

This is called by the program controller to eject a command from rMem to the I/O device. This method should be redefined by object transport-aware subclasses.

Parameters
commandThe command from the Replicode (cmd ...).
Returns
The given command if it is executed as-is, or a new command object of the command that is actually executed. The program controller will make a fact from the command and inject it as the efferent copy. However, if the command is not executed, then return NULL and the program controller will put an anti-fact of the command in the mk.rdx reduction.

Definition at line 763 of file mem.cpp.

◆ find_object()

Code * r_exec::_Mem::find_object ( const std::vector< r_code::Code * > *  objects,
const char *  name 
)
static

Find the object in r_exec::Seed and objects with the given name.

Parameters
objectsThe objects array from load().
nameThe name of the symbol.
Returns
The object, or NULL if not found.

Definition at line 1386 of file mem.cpp.

◆ get_sampling_period()

std::chrono::microseconds r_exec::_Mem::get_sampling_period ( ) const
inline

Get the sampling period, which is 2 * base_period from settings.xml. This should match sampling_period in user.classes.replicode.

Definition at line 242 of file mem.h.

◆ init_timestamps()

void r_exec::_Mem::init_timestamps ( Timestamp  time_reference,
const r_code::list< P< r_code::Code >> &  objects 
)
static

This is called on starting the executive to adjust all user-defined objects by adding time_reference to any time stamp (fact timings as well as other time stamps). Therefore, if the object is defined with a time stamp of 100ms, it is changed to time_reference + 100ms.

Parameters
time_referenceThe value to add to the time stamps of all objects.
objectsThe list of objects to search for time stamps.

Definition at line 430 of file mem.cpp.

◆ inject()

void r_exec::_Mem::inject ( View view,
bool  is_from_io_device = false 
)

Call bind which assigns an OID to the view's object and inject the view. However, if the view's injection time is later than now, then create an InjectionJob which will call bind and inject the view at the injection time.

Parameters
viewThe View to inject.
is_from_io_deviceTrue if this is called from inject_from_io_device(). This is only needed to pass to the InjectionJob so that it will log the I/O device inject.

Definition at line 989 of file mem.cpp.

◆ inject_fact_from_io_device() [1/2]

View* r_exec::_Mem::inject_fact_from_io_device ( r_code::Code object,
Timestamp  after,
Timestamp  before,
r_code::Code group 
)
inline

Inject (fact object after before 1 1) [SYNC_PERIODIC after 1 1 group nil] This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objectThe fact's object, which you must allocated and construct. (For mk.val, use one of the methods for injectMarkerValue...)
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 786 of file mem.h.

◆ inject_fact_from_io_device() [2/2]

View * r_exec::_Mem::inject_fact_from_io_device ( r_code::Code object,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode,
r_code::Code group 
)

Inject (fact object after before 1 1) [sync_mode after 1 1 group nil] This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objectThe fact's object, which you must allocated and construct. (For mk.val, use one of the methods for injectMarkerValue...)
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 974 of file mem.cpp.

◆ inject_from_io_device()

void r_exec::_Mem::inject_from_io_device ( View view)

This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
viewThe View for inject(view).

Definition at line 819 of file mem.cpp.

◆ inject_marker_value_from_io_device() [1/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
Atom  val,
Timestamp  after,
Timestamp  before 
)
inline

Inject (fact (mk.val obj prop val 1) after before 1 1) [SYNC_PERIODIC after 1 1 stdin nil] where val is a simple Atom. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe Atom value for the mk.val, such as Atom::Float(1).
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
Returns
The created View.

Definition at line 408 of file mem.h.

◆ inject_marker_value_from_io_device() [2/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
Atom  val,
Timestamp  after,
Timestamp  before,
r_code::Code group 
)
inline

Inject (fact (mk.val obj prop val 1) after before 1 1) [SYNC_PERIODIC after 1 1 group nil] where val is a simple Atom. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe Atom value for the mk.val, such as Atom::Float(1).
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 388 of file mem.h.

◆ inject_marker_value_from_io_device() [3/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
Atom  val,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode 
)
inline

Inject (fact (mk.val obj prop val 1) after before 1 1) [sync_mode after 1 1 stdin nil] where val is a simple Atom. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe Atom value for the mk.val, such as Atom::Float(1).
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
Returns
The created View.

Definition at line 367 of file mem.h.

◆ inject_marker_value_from_io_device() [4/21]

View * r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
Atom  val,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode,
r_code::Code group 
)

Inject (fact (mk.val obj prop val 1) after before 1 1) [sync_mode after 1 1 group nil] where val is a simple Atom. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe Atom value for the mk.val, such as Atom::Float(1).
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 829 of file mem.cpp.

◆ inject_marker_value_from_io_device() [5/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
const std::string &  val,
Timestamp  after,
Timestamp  before 
)
inline

Inject (fact (mk.val obj prop val 1) after before 1 1) [SYNC_PERIODIC after 1 1 stdin nil] where val is a string object. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is a string object. This will add it to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
Returns
The created View.

Definition at line 577 of file mem.h.

◆ inject_marker_value_from_io_device() [6/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
const std::string &  val,
Timestamp  after,
Timestamp  before,
r_code::Code group 
)
inline

Inject (fact (mk.val obj prop val 1) after before 1 1) [SYNC_PERIODIC after 1 1 group nil] where val is a string object. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is a string object. This will add it to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 557 of file mem.h.

◆ inject_marker_value_from_io_device() [7/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
const std::string &  val,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode 
)
inline

Inject (fact (mk.val obj prop val 1) after before 1 1) [sync_mode after 1 1 stdin nil] where val is a string object. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is a string object. This will add it to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
Returns
The created View.

Definition at line 535 of file mem.h.

◆ inject_marker_value_from_io_device() [8/21]

View * r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
const std::string &  val,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode,
r_code::Code group 
)

Inject (fact (mk.val obj prop val 1) after before 1 1) [sync_mode after 1 1 group nil] where val is a string object. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is a string object. This will add it to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 899 of file mem.cpp.

◆ inject_marker_value_from_io_device() [9/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
const std::vector< r_code::Code * > &  val,
Timestamp  after,
Timestamp  before 
)
inline

Inject (fact (mk.val obj prop [o1 o2] 1) after before 1 1) [SYNC_PERIODIC after 1 1 stdin nil] where val is a set of referenced Code objects. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is set of existing Code object, possibly empty. This will add the objects to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
Returns
The created View.

Definition at line 662 of file mem.h.

◆ inject_marker_value_from_io_device() [10/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
const std::vector< r_code::Code * > &  val,
Timestamp  after,
Timestamp  before,
r_code::Code group 
)
inline

Inject (fact (mk.val obj prop [o1 o2] 1) after before 1 1) [SYNC_PERIODIC after 1 1 group nil] where val is a set of referenced Code objects. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is set of existing Code object, possibly empty. This will add the objects to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 640 of file mem.h.

◆ inject_marker_value_from_io_device() [11/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
const std::vector< r_code::Code * > &  val,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode 
)
inline

Inject (fact (mk.val obj prop [o1 o2] 1) after before 1 1) [sync_mode after 1 1 stdin nil] where val is a set of referenced Code objects. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is set of existing Code object, possibly empty. This will add the objects to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
Returns
The created View.

Definition at line 618 of file mem.h.

◆ inject_marker_value_from_io_device() [12/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
const std::vector< r_code::Code * > &  val,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode,
r_code::Code group 
)

Inject (fact (mk.val obj prop [o1 o2] 1) after before 1 1) [sync_mode after 1 1 group nil] where val is a set of referenced Code objects. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is set of existing Code object, possibly empty. This will add the objects to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
groupThe group of the view, such as get_stdin().
Returns
The created View.

◆ inject_marker_value_from_io_device() [13/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
r_code::Code val,
Timestamp  after,
Timestamp  before 
)
inline

Inject (fact (mk.val obj prop val 1) after before 1 1) [SYNC_PERIODIC after 1 1 stdin nil] where val is a referenced Code object. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is an existing Code object. This will add it to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
Returns
The created View.

Definition at line 493 of file mem.h.

◆ inject_marker_value_from_io_device() [14/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
r_code::Code val,
Timestamp  after,
Timestamp  before,
r_code::Code group 
)
inline

Inject (fact (mk.val obj prop val 1) after before 1 1) [SYNC_PERIODIC after 1 1 group nil] where val is a referenced Code object. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is an existing Code object. This will add it to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 472 of file mem.h.

◆ inject_marker_value_from_io_device() [15/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
r_code::Code val,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode 
)
inline

Inject (fact (mk.val obj prop val 1) after before 1 1) [sync_mode after 1 1 stdin nil] where val is a referenced Code object. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is an existing Code object. This will add it to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
Returns
The created View.

Definition at line 450 of file mem.h.

◆ inject_marker_value_from_io_device() [16/21]

View * r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
r_code::Code val,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode,
r_code::Code group 
)

Inject (fact (mk.val obj prop val 1) after before 1 1) [sync_mode after 1 1 group nil] where val is a referenced Code object. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe value for the mk.val, which is an existing Code object. This will add it to the references of the mkval.
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 877 of file mem.cpp.

◆ inject_marker_value_from_io_device() [17/21]

View * r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
std::vector< Atom val,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode,
r_code::Code group 
)

Inject (fact (mk.val obj prop val 1) after before 1 1) [sync_mode after 1 1 group nil] where val is a set of Atoms. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
valThe Atom value for the mk.val, such as Atom::Float(1).
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 850 of file mem.cpp.

◆ inject_marker_value_from_io_device() [18/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
uint16  opcode,
const std::vector< r_code::Atom > &  vals,
Timestamp  after,
Timestamp  before 
)
inline

Inject (fact (mk.val obj prop (opcode val1 val2 ...) 1) after before 1 1) [SYNC_PERIODIC after 1 1 stdin nil] where val1 val2 ... come from the vals Atom list. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
opcodeThe opcode for the value structure.
valsThe list of Atom for val1 val2 ....
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
Returns
The created View.

Definition at line 749 of file mem.h.

◆ inject_marker_value_from_io_device() [19/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
uint16  opcode,
const std::vector< r_code::Atom > &  vals,
Timestamp  after,
Timestamp  before,
r_code::Code group 
)
inline

Inject (fact (mk.val obj prop (opcode val1 val2 ...) 1) after before 1 1) [SYNC_PERIODIC after 1 1 group nil] where val1 val2 ... come from the vals Atom list. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
opcodeThe opcode for the value structure.
valsThe list of Atom for val1 val2 ....
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
groupThe group of the view, such as get_stdin().
Returns
The created View.

Definition at line 727 of file mem.h.

◆ inject_marker_value_from_io_device() [20/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
uint16  opcode,
const std::vector< r_code::Atom > &  vals,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode 
)
inline

Inject (fact (mk.val obj prop (opcode val1 val2 ...) 1) after before 1 1) [sync_mode after 1 1 stdin nil] where val1 val2 ... come from the vals Atom list. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
opcodeThe opcode for the value structure.
valsThe list of Atom for val1 val2 ....
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
Returns
The created View.

Definition at line 705 of file mem.h.

◆ inject_marker_value_from_io_device() [21/21]

View* r_exec::_Mem::inject_marker_value_from_io_device ( r_code::Code obj,
r_code::Code prop,
uint16  opcode,
const std::vector< r_code::Atom > &  vals,
Timestamp  after,
Timestamp  before,
View::SyncMode  sync_mode,
r_code::Code group 
)

Inject (fact (mk.val obj prop (opcode val1 val2 ...) 1) after before 1 1) [sync_mode after 1 1 group nil] where val1 val2 ... come from the vals Atom list. This is called from the I/O device to call the normal inject(view), then log the injection event.

Parameters
objThe object for the mk.val.
propThe property for the mk.val.
opcodeThe opcode for the value structure.
valsThe list of Atom for val1 val2 ....
afterThe start of the fact time interval.
beforeThe end of the fact time interval.
sync_modeThe view sync mode, such as View::SYNC_PERIODIC.
groupThe group of the view, such as get_stdin().
Returns
The created View.

◆ matches_axiom()

bool r_exec::_Mem::matches_axiom ( r_code::Code obj)

Check if an object matches the value of a fact in the seed whose view is SYNC_AXIOM.

Parameters
objA fact's value such as (mk.val b essence ball 1).
Returns
True if the object matches an axiom.

Definition at line 1416 of file mem.cpp.

◆ Output()

std::ostream & r_exec::_Mem::Output ( TraceLevel  l)
static

Get the output stream for the trace level based on (Mem::Get()->runtime_output_streams[l]. If (Mem::Get()->runtime_output_streams[l] is NULL, use default_runtime_output_stream_.

Parameters
lThe TraceLevel.
Returns
A reference to the output stream, which may be a NullOStream if the bit in settings.xml "trace_levels" was zero.

Definition at line 213 of file mem.cpp.

◆ run_in_diagnostic_time()

void r_exec::_Mem::run_in_diagnostic_time ( std::chrono::milliseconds  run_time)

When reduction and core count == 0, start() does not start any core threads, so call this instead of Thread::Sleep(run_time) to run in the current thread using "diagnostic time".As opposed to real time which uses Time::Get, diagnostic time uses get_diagnostic_time_now() which simply returns diagnostic_time_now_. (The main() function should call r_exec::Init where time_base is get_diagnostic_time_now.) So, run_in_diagnostic_time updates diagnostic_time_now_ based on the next time job(which always runs on time). This way, the return value of Now() does not move with real time, but moves step-by-step when diagnostic_time_now_ is updated, making it possible to set break points and diagnose the program.

Parameters
run_timeThe number of milliseconds (in diagnostic time) to run for.

Definition at line 525 of file mem.cpp.

◆ set_default_runtime_output_stream()

void r_exec::_Mem::set_default_runtime_output_stream ( std::ostream *  default_runtime_output_stream)
inline

Set the runtime output stream which Output returns when a trace level is NULL.

Parameters
default_runtime_output_streamThe stream.

Definition at line 887 of file mem.h.


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