unity3d-opencog-game icon indicating copy to clipboard operation
unity3d-opencog-game copied to clipboard

[Task] Handling errors in our planner Unity side

Open Spydrouge opened this issue 11 years ago • 2 comments

Task Go back through our code and handle planner errors consistantly.

Answer

"In general, I don't think we can detect planning errors since a single action might take as many as 5 attempts to successfully complete. That said, if it fails 5 attempts, you can probably call it an error or throw an exception. It should flunk unit tests though, since a change to opencog that breaks the planner from a previously working position is still an error."

Question (Answered) Our planner is so... silly... at the moment that I'm not entirely sure whether I want to even fix this, or how to handle it. Basically we report to the planner we failed to execute its plan because the planner needs serious editing. Our UnitTests would hypothetically accept this as a sign everything is working as normal (which would sadly be true) and it doesn't seem to make sense to print an error unity side when the planner is the culprit AND isn't any more broken than it was to begin with...

image

The relevant code is:

UnityEngine.Debug.Log(OCLogSymbol.CLEARED + "Queued message to report '" + ((success ? "done (success)" : "error") + "' on actionPlan " + planId));

And obviously its easy to fix it print an error, but before tackling that, I want to know how the UnitTests should handle anything similar (which should never happen because i place the battery in an ideal slot- but hey, ya never know!)

Spydrouge avatar Dec 04 '14 06:12 Spydrouge

@Nemquae got any ideas? I could use some standard razor statement which I can use in the unity game to handle whenever the planner screws up. Should I print errors? Warnings? Throw exceptions? Flunk unit tests?

I'm of the opinion I should convert all handlings of a silly planner into printing warnings. That way its loud and clear something is wrong- but that it's not our fault and we don't have to fix it here.

Spydrouge avatar Dec 09 '14 09:12 Spydrouge

Have you considered LogException? http://docs.unity3d.com/ScriptReference/Debug.LogException.html In general, I don't think we can detect planning errors since a single action might take as many as 5 attempts to successfully complete. That said, if it fails 5 attempts, you can probably call it an error or throw an exception. It should flunk unit tests though, since a change to opencog that breaks the planner from a previously working position is still an error.

On Tue, Dec 9, 2014 at 5:37 PM, Spydrouge [email protected] wrote:

@Nemquae https://github.com/Nemquae got any ideas? I could use some standard razor statement which I can use in the unity game to handle whenever the planner screws up. Should I print errors? Warnings? Throw exceptions? Flunk unit tests?

I'm of the opinion I should convert all handlings of a silly planner into printing warnings. That way its loud and clear something is wrong- but that it's not our fault.

— Reply to this email directly or view it on GitHub https://github.com/opencog/unity3d-opencog-game/issues/58#issuecomment-66256405 .

Nemquae avatar Dec 09 '14 09:12 Nemquae