The AI Engine
This forum is for discussion of how The Personality Forge's AI Engine works. This is the place for questions on what means what, how to script, and ideas and plans for the Engine.
Posts 6,652 - 6,663 of 7,766
<?PF if (mem-mymemory) > "15"; ?>
I don't think the 'greater than' sign is going to work comparing 2 strings I'm afraid
The only way round it I know of is to laboriously specify eg:
if (mem-mymemory) is "1";
if (mem-mymemory) is "2";
if (mem-mymemory) is "3";
if (mem-mymemory) is "4";
...
if (mem-mymemory) is "15";
etc.
I just hope you don't need to count up to thousands (anything over 40 is a PITA, because you have to span several keyphrases to accomodate all the responses!)
Posts 6,652 - 6,663 of 7,766
Rykxx
16 years ago
16 years ago
Irina, you probably have a "what is" keyphrase with the (definition) plugin being triggered, which would explain why it doesn't sound like Irina K. You need to adjust your keyphrase rankings....
Endlessly I've found.....
Endlessly I've found.....

marco3b
16 years ago
16 years ago
Hallo,
I'm still here unable to understand AI engine...
I read in AI Book a conditional memory as: {?PF if emotion > 3; ?}
I wonder why do not use with other memory types... So I defined a memory:
default "" as "mymemory";
then assign to it a numeric value.
So I tryed an answer followed by a conditional statment:
<?PF if (mem-mymemory) > 15; ?>
When I import the file I have an error:
ERROR: The following AIScript statement is incorrectly formatted: "if (mem-mymemory) > 15". Please correct this and try again.
Where is my mistake?
Any idea?
I'm still here unable to understand AI engine...
I read in AI Book a conditional memory as: {?PF if emotion > 3; ?}
I wonder why do not use with other memory types... So I defined a memory:
default "" as "mymemory";
then assign to it a numeric value.
So I tryed an answer followed by a conditional statment:
<?PF if (mem-mymemory) > 15; ?>
When I import the file I have an error:
ERROR: The following AIScript statement is incorrectly formatted: "if (mem-mymemory) > 15". Please correct this and try again.
Where is my mistake?
Any idea?
kaskroute
16 years ago
16 years ago
I think that memories are stored as strings.
The test "> 15" is for numbers.
That's a type mismatch.
I don't know if you can really do what you want (maybe the AIEngine should be changed with implicit conversion)
The test "> 15" is for numbers.
That's a type mismatch.
I don't know if you can really do what you want (maybe the AIEngine should be changed with implicit conversion)
Irina
16 years ago
16 years ago
marco3b:
Yes, kaskroute is correct -- you need to write
<?PF if (mem-mymemory) > "15"; ?>
In general, constants have to be quoted, e.g.,
<?PF rem "3" as only "variable"; ?>
Yes, kaskroute is correct -- you need to write
<?PF if (mem-mymemory) > "15"; ?>
In general, constants have to be quoted, e.g.,
<?PF rem "3" as only "variable"; ?>
psimagus
16 years ago
16 years ago
I don't think the 'greater than' sign is going to work comparing 2 strings I'm afraid

The only way round it I know of is to laboriously specify eg:
if (mem-mymemory) is "1";
if (mem-mymemory) is "2";
if (mem-mymemory) is "3";
if (mem-mymemory) is "4";
...
if (mem-mymemory) is "15";
etc.
I just hope you don't need to count up to thousands (anything over 40 is a PITA, because you have to span several keyphrases to accomodate all the responses!)
Eugene Meltzner
16 years ago
16 years ago
Yeah, we don't have access to a function to convert a string to a numerical value.
kaskroute
16 years ago
16 years ago
If what I think is correct, the test > "15" may be wrong.
Indeed, "2" > "15" (alphanumeric order) but 2 < 15
Indeed, "2" > "15" (alphanumeric order) but 2 < 15
Irina
16 years ago
16 years ago
I could have sworn I'd seen something about inequalities in the Book of A.I., but I just looked again and didn't find anything. I must now confess total ignorance!
» More new posts: Doghead's Cosmic Bar