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

[solver] add unseccessful perfomance option in DirectInferenceAgent #82

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,26 @@ ScResult DirectInferenceAgent::DoProgram(ScActionInitiatedEvent const & event, S
ScAddr solutionNode = inferenceManager->getSolutionTreeManager()->createSolution(outputStructure, targetAchieved);

action.FormResult(solutionNode);

ScIterator3Ptr successSolutionEdgeIterator =
m_context.CreateIterator3(InferenceKeynodes::concept_success_solution, ScType::Unknown, solutionNode); //searching for successSoclutionEdge Type
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider specifying the expected edge type in CreateIterator3 instead of using ScType::Unknown for clarity and to avoid ambiguity.

// type is negative - target wasn't achieved
// type is positive - target was achieved

while (successSolutionEdgeIterator->Next())
{
ScAddr successSolutionEdge = successSolutionEdgeIterator->Get(1);
ScType const & successSolutionEdgeType = m_context.GetElementType(successSolutionEdge);
if (successSolutionEdgeType == ScType::EdgeAccessConstNegPerm)
{
SC_AGENT_LOG_ERROR("Target wasn't achieved");
return action.FinishUnsuccessfully();
}
}


return action.FinishSuccessfully();
}

ScAddr DirectInferenceAgent::GetActionClass() const
{
return InferenceKeynodes::action_direct_inference;
Expand Down