We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am running the examples with a scenario of updating the goals at runtime, and it seems once the agent is created with goals they can't be updated.
here is an example
_ = new DefaultLogger(true); var goal = new ComparativeGoal( name: "Travel 50 miles", desiredState: new() { { "distanceTraveled", new() { Operator = ComparisonOperator.GreaterThanOrEquals, Value = 50 } } }); var walkAction = new Action( name: "Walk", cost: 50, postconditions: new() { { "distanceTraveled", 50 } }, executor: TravelExecutor ); var driveAction = new Action( name: "Drive", cost: 5, preconditions: new() { { "inCar", true } }, postconditions: new() { { "distanceTraveled", 50 } }, executor: TravelExecutor ); var getInCarAction = new Action( name: "Get in Car", cost: 1, preconditions: new() { { "inCar", false } }, postconditions: new() { { "inCar", true } }, executor: GetInCarExecutor ); var agent = new Agent( name: "Driving Agent", state: new() { { "distanceTraveled", 0 }, { "inCar", false } } ); agent.Goals.Add(goal); agent.Actions.Add(walkAction); agent.Actions.Add(driveAction); agent.Actions.Add(getInCarAction); agent.Step(StepMode.OneAction); agent.Step(StepMode.OneAction); agent.Step(StepMode.OneAction); var newGoal = new ComparativeGoal( name: "Travel 60 miless", desiredState: new() { { "distanceTraveled", new() { Operator = ComparisonOperator.GreaterThanOrEquals, Value = 60 } } }); agent.Goals.Clear(); agent.Goals.Add(newGoal); agent.Step(StepMode.OneAction); agent.Step(StepMode.OneAction); agent.Step(StepMode.OneAction);
It throws
:0 @ void System.Runtime.CompilerServices.CastHelpers.StelemRef(System.Array , IntPtr , System.Object ): System.IndexOutOfRangeException: Index was outside the bounds of the array. <C++ Error> System.IndexOutOfRangeException <C++ Source> :0 @ void System.Runtime.CompilerServices.CastHelpers.StelemRef(System.Array , IntPtr , System.Object ) <Stack Trace> :0 @ void System.Runtime.CompilerServices.CastHelpers.StelemRef(System.Array , IntPtr , System.Object ) :0 @ MountainGoap.ActionAStar..ctor(MountainGoap.ActionGraph , MountainGoap.ActionNode , MountainGoap.BaseGoal , Single , Int32 )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am running the examples with a scenario of updating the goals at runtime, and it seems once the agent is created with goals they can't be updated.
here is an example
It throws
The text was updated successfully, but these errors were encountered: