Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Typedefs | Functions
rhsfun_math.h File Reference

Go to the source code of this file.

Typedefs

typedef struct agent_struct agent
typedef char Bool

Functions

void init_built_in_rhs_math_functions (agent *thisAgent)
void remove_built_in_rhs_math_functions (agent *thisAgent)

Typedef Documentation

typedef struct agent_struct agent

Definition at line 25 of file rhsfun_math.h.

typedef char Bool

Definition at line 24 of file rhsfun_math.h.

Function Documentation

void init_built_in_rhs_math_functions ( agent thisAgent)

Definition at line 1315 of file rhsfun_math.cpp.

References abs_rhs_function_code(), add_rhs_function(), atan2_rhs_function_code(), compute_heading_rhs_function_code(), compute_range_rhs_function_code(), cos_rhs_function_code(), dice_prob_rhs_function_code(), div_rhs_function_code(), FALSE, float_rhs_function_code(), fp_divide_rhs_function_code(), int_rhs_function_code(), make_sym_constant(), minus_rhs_function_code(), mod_rhs_function_code(), plus_rhs_function_code(), rand_float_rhs_function_code(), rand_int_rhs_function_code(), round_off_air_rhs_function_code(), round_off_heading_air_rhs_function_code(), sin_rhs_function_code(), sqrt_rhs_function_code(), times_rhs_function_code(), and TRUE.

Referenced by init_built_in_rhs_functions().

{
-1, TRUE, FALSE, 0);
-1, TRUE, FALSE, 0);
-1, TRUE, FALSE, 0);
-1, TRUE, FALSE, 0);
add_rhs_function (thisAgent, make_sym_constant (thisAgent, "div"), div_rhs_function_code,
2, TRUE, FALSE, 0);
add_rhs_function (thisAgent, make_sym_constant (thisAgent, "mod"), mod_rhs_function_code,
2, TRUE, FALSE, 0);
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "sin"),
1,
FALSE, 0);
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "cos"),
1,
FALSE, 0);
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "atan2"),
2,
FALSE, 0);
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "sqrt"),
1,
FALSE, 0);
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "abs"),
1,
FALSE, 0);
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "int"),
1,
FALSE, 0);
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "float"),
1,
FALSE, 0);
/* voigtjr 6/12/2007: added these built in functions on laird's request
these are straight out of the <8.6 kernel */
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "round-off-heading"),
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "round-off"),
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "compute-heading"),
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "compute-range"),
// NLD: 11/11 (ditto voigtjr's motivation above)
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "compute-dice-probability"),
// Bug 800: implement rhs rand functions
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "rand-int"),
add_rhs_function (thisAgent, make_sym_constant(thisAgent, "rand-float"),
}
void remove_built_in_rhs_math_functions ( agent thisAgent)

Definition at line 1393 of file rhsfun_math.cpp.

References find_sym_constant(), and remove_rhs_function().

Referenced by remove_built_in_rhs_functions().

{
// DJP-FREE: These used to call make_sym_constant, but the symbols must already exist and if we call make here again we leak a reference.
remove_rhs_function (thisAgent, find_sym_constant (thisAgent, "+"));
remove_rhs_function (thisAgent, find_sym_constant (thisAgent, "*"));
remove_rhs_function (thisAgent, find_sym_constant (thisAgent, "-"));
remove_rhs_function (thisAgent, find_sym_constant (thisAgent, "/"));
remove_rhs_function (thisAgent, find_sym_constant (thisAgent, "div"));
remove_rhs_function (thisAgent, find_sym_constant (thisAgent, "mod"));
remove_rhs_function (thisAgent, find_sym_constant(thisAgent, "sin"));
remove_rhs_function (thisAgent, find_sym_constant(thisAgent, "cos"));
remove_rhs_function (thisAgent, find_sym_constant(thisAgent, "atan2"));
remove_rhs_function (thisAgent, find_sym_constant(thisAgent, "sqrt"));
remove_rhs_function (thisAgent, find_sym_constant(thisAgent, "abs"));
remove_rhs_function (thisAgent, find_sym_constant(thisAgent, "int"));
remove_rhs_function (thisAgent, find_sym_constant(thisAgent, "float"));
/* voigtjr 6/12/2007: added these built in functions on laird's request
these are straight out of the <8.6 kernel */
remove_rhs_function(thisAgent, find_sym_constant(thisAgent, "round-off-heading"));
remove_rhs_function(thisAgent, find_sym_constant(thisAgent, "round-off"));
remove_rhs_function(thisAgent, find_sym_constant(thisAgent, "compute-heading"));
remove_rhs_function(thisAgent, find_sym_constant(thisAgent, "compute-range"));
// NLD: 11/11
remove_rhs_function(thisAgent, find_sym_constant(thisAgent, "compute-dice-probability"));
// Bug 800: implement rand
remove_rhs_function(thisAgent, find_sym_constant(thisAgent, "rand-int"));
remove_rhs_function(thisAgent, find_sym_constant(thisAgent, "rand-float"));
}