hey
im making a decision table, and i have 8/9 rules with each answer being y or n. This is going to mean there are over 250 combernations!
I was wondering if there is a program that works this out for you?
Cheers
Laura
Printable View
hey
im making a decision table, and i have 8/9 rules with each answer being y or n. This is going to mean there are over 250 combernations!
I was wondering if there is a program that works this out for you?
Cheers
Laura
Welcome to VBForums :wave:
There are some algorithms that can do that, but what do you mean with decision table? Like an array? Can you clarify your idea a bit?
hey
sorry for not making myself clear, kind of hard to explain.
I have to make a decision table and it looks like this
hopefull this will help :)
RULE | DOCTOR
---------------------------------------------------
Name|y|n|n|n|
Addy|Y|y|n|n|
Date|y|y|y|n|
Time|y|y|y|y|
Book?|y|n|n|n|
to explain this table:
I have the rules that have to be yes in order for the booking to go a head.
If they are all Y then the booking is a y
If even one of them is a n then the booking is a n
I have about 8 or 9 rules before the booking, which means i have over 200 different combernations (sp?) to work out
Does this make sense?
Hi Laura.
One way to do this would be to scan the array of answers and add 1 to a counter for all "Y" you encounter.
If the final result is less than 8 or 9 then it would be a no.
Example:
VB Code:
dim Answers(9) as string dim Counter as integer,a as integer for a=1 to 9 if ucase(Answers(a))="Y" then Counter=counter+1 next if counter<9 then Msgbox "No booking!"
I don't know what your code looks like, if you even use an array so this will probably not fit into your code without modifications...
You don't need to evaluate every possible combination.
You need to evaluate each rule one by one and if one of the rules is false you make the decision false.
OrVB Code:
decision = (rule1 And rule2 And rule3 And rule4)decision and the rules are booleans.VB Code:
decision = True decision = decision And rule1 decision = decision And rule2 decision = decision And rule3 decision = decision And rule4