V-Sekai / godot-goal-task-planner

Other
6 stars 1 forks source link

Open Github Discussion #30

Closed GeorgeS2019 closed 4 months ago

GeorgeS2019 commented 4 months ago

Describe the proposed feature and how it helps to overcome a problem or limitation

Open Github Discussion

Other information about your context or usecase.

No response

If known, describe how your proposal will work, with code, pseudo-code, mock-ups, or diagrams

No response

Anything else

No response

GeorgeS2019 commented 4 months ago

https://github.com/V-Sekai/godot-task-goal-planner/blob/4e93440e6357a95544147202ae84bb5bc3a92214/goal_task_tests/core_problems/test_simple_htn.gd#L37-L41

https://github.com/V-Sekai/godot-task-goal-planner/blob/4e93440e6357a95544147202ae84bb5bc3a92214/goal_task_tests/core_problems/test_simple_htn.gd#L22-L26

By using Dictionary element as string instead of proper type like Enum

    // Define types
    public enum Person { Alice, Bob }
    public enum Location { HomeA, HomeB, Park, Station }
    public enum Taxi { Taxi1, Taxi2 }

We are faced with mixing enum types e.g. Person and Taxi of different real world objects within one Dictionary as Key!

    // Define initial state
    private Dictionary<object, Location> loc = new Dictionary<object, Location>
    {
        [Person.Alice] = Location.HomeA,
        [Person.Bob] = Location.HomeB,
        [Taxi.Taxi1] = Location.Park,
        [Taxi.Taxi2] = Location.Station
    };