Skip to content
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

Find goal satisfaction from a plan #104

Open
tydawson opened this issue Dec 12, 2023 · 0 comments
Open

Find goal satisfaction from a plan #104

tydawson opened this issue Dec 12, 2023 · 0 comments
Labels
enhancement New/improved features and capabilities

Comments

@tydawson
Copy link

In order to meet some of the requirements of a Mission Sim Report MPST is developing, we needed a way to get goal satisfaction from any given plan.

Through discussions with Alex Greer and Megan Jones, it looks like the following queries could be ran to get the goal satisfaction of a plan:

First, find the spec_id from this query:

query MyQuery { scheduling_specification(where: {plan_id: {_eq: $plan_id}}) { id } }

Then feed that spec_id into this query:

query MyQuery { scheduling_goal_analysis(where: {request: {specification_id: {_eq: $spec_id}}}) { goal_id analysis_id satisfied satisfying_activities_aggregate { aggregate { count(distinct: false) } } } }

And it should give you:

{ "data": { "scheduling_goal_analysis": [ { "goal_id": 27, "analysis_id": 80, "satisfied": false, "satisfying_activities_aggregate": { "aggregate": { "count": 59 } } }, { "goal_id": 26, "analysis_id": 81, "satisfied": false, "satisfying_activities_aggregate": { "aggregate": { "count": 270 } } } ] } }

You can tell if a goal is satisfied because the "satisfied" field in the query response will say true, goals are partially satisfied if the "count" number is non-zero but "satisfied" is false. If count is 0 and "satisfied" is false the goals is unsatisfied.

You can get the names for the goal_ids in the response above using this query:

query MyQuery { scheduling_goal(where: {id: {_eq: 27}}) { author name revision id definition description created_date modified_date model_id last_modified_by } }

Ideally, we would just filter for the last run for each goal so the result does not show all scheduling goal run results in that plan. It should also return all the info of the goal for that run, from the last query.

@cartermak cartermak added the enhancement New/improved features and capabilities label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New/improved features and capabilities
Projects
None yet
Development

No branches or pull requests

2 participants