@Test public void testCanParseAnLtiNameForIdentifierLexeme() { final Lexeme lexeme = new Lexeme(); lexeme.type = LexemeType.IDENTIFIER; lexeme.string = "Z99"; lexeme.id_letter = 'Z'; lexeme.id_number = 99; final ParsedLtiName parsed = DefaultSemanticMemory.smem_parse_lti_name(lexeme); assertNotNull(parsed); assertEquals("Z99", parsed.value); assertEquals('Z', parsed.id_letter); assertEquals(99, parsed.id_number); }
static ParsedLtiName smem_parse_lti_name(Lexeme lexeme) { if (lexeme.type == LexemeType.IDENTIFIER) { return new ParsedLtiName(String.format("%c%d", lexeme.id_letter, lexeme.id_number), lexeme.id_letter, lexeme.id_number); } else { return new ParsedLtiName(lexeme.string, Character.toUpperCase(lexeme.string.charAt(1)), 0); } }
DefaultSemanticMemory implements SemanticMemory { static ParsedLtiName smem_parse_lti_name(Lexeme lexeme) { if (lexeme.type == LexemeType.IDENTIFIER) { return new ParsedLtiName(String.format("%c%d", lexeme.id_letter, lexeme.id_number), lexeme.id_letter, lexeme.id_number); } else { return new ParsedLtiName(lexeme.string, Character.toUpperCase(lexeme.string.charAt(1)), 0); } } }
DefaultSemanticMemory implements SemanticMemory { static ParsedLtiName smem_parse_lti_name(Lexeme lexeme) { if (lexeme.type == LexemeType.IDENTIFIER) { return new ParsedLtiName(String.format("%c%d", lexeme.id_letter, lexeme.id_number), lexeme.id_letter, lexeme.id_number); } else { return new ParsedLtiName(lexeme.string, Character.toUpperCase(lexeme.string.charAt(1)), 0); } } DefaultSemanticMemory(Adaptable context);  DefaultSemanticMemory(Adaptable context, SemanticMemoryDatabase db); }
DefaultSemanticMemory implements SemanticMemory { static ParsedLtiName smem_parse_lti_name(Lexeme lexeme) { if (lexeme.type == LexemeType.IDENTIFIER) { return new ParsedLtiName(String.format("%c%d", lexeme.id_letter, lexeme.id_number), lexeme.id_letter, lexeme.id_number); } else { return new ParsedLtiName(lexeme.string, Character.toUpperCase(lexeme.string.charAt(1)), 0); } } DefaultSemanticMemory(Adaptable context);  DefaultSemanticMemory(Adaptable context, SemanticMemoryDatabase db); BasicWeightedCue getLastCue(); void initialize(); @Override void resetStatistics(); @Override SemanticMemoryStatistics getStatistics(); @Override void initializeNewContext(WorkingMemory wm, IdentifierImpl id); @Override boolean smem_enabled(); double smem_lti_calc_base(long lti, long time_now); double smem_lti_calc_base(long lti, long time_now, long n); double smem_lti_calc_base(long lti, long time_now, long n, long activations_first); static boolean smem_valid_production(Condition lhs_top, Action rhs_top); @Override long smem_lti_get_id(char name_letter, long name_number); IdentifierImpl smem_lti_soar_make(/* smem_lti_id */long lti, char name_letter, long name_number, /* goal_stack_level */int level); @Override void smem_reset_id_counters(); @Override void smem_reset(IdentifierImpl state); @Override void smem_attach(); @Override void smem_close(); @Override void smem_go(boolean store_only); @Override boolean isMirroringEnabled(); @Override Set<IdentifierImpl> smem_changed_ids(); @Override boolean smem_ignore_changes(); }
DefaultSemanticMemory implements SemanticMemory { static ParsedLtiName smem_parse_lti_name(Lexeme lexeme) { if (lexeme.type == LexemeType.IDENTIFIER) { return new ParsedLtiName(String.format("%c%d", lexeme.id_letter, lexeme.id_number), lexeme.id_letter, lexeme.id_number); } else { return new ParsedLtiName(lexeme.string, Character.toUpperCase(lexeme.string.charAt(1)), 0); } } DefaultSemanticMemory(Adaptable context);  DefaultSemanticMemory(Adaptable context, SemanticMemoryDatabase db); BasicWeightedCue getLastCue(); void initialize(); @Override void resetStatistics(); @Override SemanticMemoryStatistics getStatistics(); @Override void initializeNewContext(WorkingMemory wm, IdentifierImpl id); @Override boolean smem_enabled(); double smem_lti_calc_base(long lti, long time_now); double smem_lti_calc_base(long lti, long time_now, long n); double smem_lti_calc_base(long lti, long time_now, long n, long activations_first); static boolean smem_valid_production(Condition lhs_top, Action rhs_top); @Override long smem_lti_get_id(char name_letter, long name_number); IdentifierImpl smem_lti_soar_make(/* smem_lti_id */long lti, char name_letter, long name_number, /* goal_stack_level */int level); @Override void smem_reset_id_counters(); @Override void smem_reset(IdentifierImpl state); @Override void smem_attach(); @Override void smem_close(); @Override void smem_go(boolean store_only); @Override boolean isMirroringEnabled(); @Override Set<IdentifierImpl> smem_changed_ids(); @Override boolean smem_ignore_changes();  }