Skip to content

Commit

Permalink
Extended smem cli commands history, export, and visualize to include …
Browse files Browse the repository at this point in the history
…LTI alises
  • Loading branch information
Aaron Mininger committed Sep 12, 2024
1 parent 1b76f16 commit ab6814b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
16 changes: 16 additions & 0 deletions Core/CLI/src/cli_smem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ bool CommandLineInterface::DoSMem(const char pOp, const std::string* pArg1, cons
lti_id = thisAgent->SMem->lti_exists(lexer.current_lexeme.int_val);
}
}
else if (lexer.current_lexeme.type == STR_CONSTANT_LEXEME)
{
if (thisAgent->SMem->connected())
{
std::string lti_alias = lexer.current_lexeme.string();
lti_id = thisAgent->SMem->get_lti_with_alias(lti_alias);
}
}

if (lti_id == NIL)
{
Expand Down Expand Up @@ -426,6 +434,14 @@ bool CommandLineInterface::DoSMem(const char pOp, const std::string* pArg1, cons
lti_id = thisAgent->SMem->lti_exists(lexer.current_lexeme.int_val);
}
}
else if (lexer.current_lexeme.type == STR_CONSTANT_LEXEME)
{
if (thisAgent->SMem->connected())
{
std::string lti_alias = lexer.current_lexeme.string();
lti_id = thisAgent->SMem->get_lti_with_alias(lti_alias);
}
}

if (lti_id == NIL)
{
Expand Down
8 changes: 8 additions & 0 deletions Core/CLI/src/cli_visualize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ bool CommandLineInterface::DoVisualize(const std::string* pArg1, const std::stri
lti_id = thisAgent->SMem->lti_exists(lexer.current_lexeme.int_val);
}
}
else if (lexer.current_lexeme.type == STR_CONSTANT_LEXEME)
{
if (thisAgent->SMem->connected())
{
std::string lti_alias = lexer.current_lexeme.string();
lti_id = thisAgent->SMem->get_lti_with_alias(lti_alias);
}
}

if (lti_id == NIL)
{
Expand Down
4 changes: 0 additions & 4 deletions Core/SoarKernel/src/semantic_memory/smem_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ typedef struct smem_edge_update_struct

typedef std::unordered_map<uint64_t, std::list<smem_edge_update*>> smem_update_map;

// Mapping from constant string aliases to integer ids
// for hard-coded LTIs in smem --add commands (such as @red)
typedef std::map<std::string, uint64_t> lti_alias_to_id_map;

typedef union ltm_value_union
{
struct ltm_value_const val_const;
Expand Down

0 comments on commit ab6814b

Please sign in to comment.