-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting properties float or int #33
Comments
I created this bypass in the ApplyEffects, after the last "else if" (I don't recommed this fix of course, I just wanted to make sure I was correct, and this fixed my bug and the agent works fine): |
Interesting, I'll look into this. Thank you for bringing it to my attention! I'm not sure I actually tested arithmeticPostconditions with floats, which is my bad. I'll make a test case for them and make sure I get them working. |
I've updated to the latest version of the main branch, and the agent has stopped working.
When debbuging, I came to the realization that my float value, when set to "0", was treated as int.
To clarify, I initialized a starting propery:
b.addStartingStateProperty("key1",0f);
where I the values of "key1" are supposed to be float.
and added an arithmeticPostconditions to my action, that added a float number to "key1".
In the class ActionGraph, in the function
internal IEnumerable Neighbors(ActionNode node)
When executing "newNode.Action?.ApplyEffects(newNode.State);", the effects were not applied.
When debbuging this function, I realized that the value of "key1" was "0", which was "int", even though I initialized it float.
To clarify, in the ApplyEffects function,
state[kvp.Key] was 0, and therefor
"state[kvp.Key] is float stateFloat" was false
"state[kvp.Key] is int stateInt" was true
yet kvp.Value was 15.1f, since I want to add a float value, and
"kvp.Value is float conditionFloat" was true
"kvp.Value is int conditionInt" was false
and therefor the ApplyEffects function didn't apply.
I'm not sure why my value is set to an integer 0 and not keep it's "float" value
Thank you!
The text was updated successfully, but these errors were encountered: