adslgeek Posted February 13, 2010 Share Posted February 13, 2010 Hey there, I have a troubleshooter I am working on and would love some help with. At the moment it is a massive bundle of nested if statements that is both un-weildy and complex to navigate and diagnose logic errors. I am trying to come up with a more elegant option and have been suggested that I move to a database option. So the logic I have been thinking of is as follows WHICH_ANIMAL_TABLE Elephant Grey, Large, Dangerous, probability low Mouse Grey, Small, Not dangerous, probability high Lion Yellow, Medium, Dangerous, probability low Input Symptoms: (eg what color) | Ask the "most halving" question (eg is size small or large) Keep asking till only 1 option left | This is a x (eg if small and grey = must be a mouse) What I am having problems with is the best way to structure this - I have been framing this in my mind as a search engine type script that loops on itself. SELECT *FROM symptoms_table where color = grey Then I need to find find the "most halving". So I thought of something like for each "rootcause" (eg mouse, elephant) count each "symptom" (eg dangerous / size etc) and divide by total root causes. Find the closest to 50% from the list and then order by probability. (I have no idea what that script / formula might look like!) This all sounds complicated when I describe it here, and the data sets of symptom to rootcause tables are actually getting quite large (including all the known modem types etc).. Finally to complicate it further it would be great if I can have little subroutines that are called on through the process (eg detect IP address, speed of the link, and other program functions etc), but possibly not mandatory, as I can scan for all the required stuff up front and pass through as variables. If it helps, the current very horrible / crappy beta version is here www.adslgeek.com/troubleshooter PS Not sure if this is the best forum, of if it is better suited to the SQL forum? Thanks in advance for any help you can provide, Cheers, ADSL geek Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.