Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java The Evidence class: This class represents an item of evidence that can be used to support or disfavor a Hypothesis. Assume that we

in java
image text in transcribed
image text in transcribed
image text in transcribed
The Evidence class: This class represents an item of evidence that can be used to support or disfavor a Hypothesis. Assume that we will use only favoring pieces of evidence and hypotheses. To evaluate the probability of an item of evidence being true, we need to know how ambiguous it is and how credible its source is. Out of the 5 well-known characteristics of an item of evidence, we will use 4 of them for simplicity. This relation depends on the type of evidence. The table below shows how this value should be estimated a priori: For instance, if the evidence type is 1 (i.e Real Evidence), its probability of being true would be: 0.4 (unambiguity) +0.3 (credibility) +0.2 (completeness) +0.1 (conclusiveness). The result will be a float value. You will use type casting to convert float to byte. This will truncate the float value. You need to implement constructors and methods to instantiate the fields of an Evidence. Fields: - description: a String that represents the description of the evidence. - type: a byte that represents the type of evidence. The default value is 5. - unambiguity: a byte that represents the unambiguity of evidence. - credibility: a byte that represents the credibility of evidence. - completeness: a byte that represents the completeness of evidence. - conclusiveness: a byte that represents the conclusiveness of evidence. - probability: a byte that represents the probability of this evidence being true. The getters will be public and will have the following signature: - String getDescription() - byte getType() - byte getUnambiguity() - byte getCredibility() - byte getCompleteness() - byte getConclusiveness() - byte getProbability() The setters will be public and will have the following signature: - void setDescription(String description) - void setType(byte type): - You must check if the value type is between 1 and 5. Otherwise set the value to 5. - void setUnambiguity(byte unambiguity) - void setCredibility(byte credibility) - void setCompleteness(byte completeness) - void setConclusiveness(byte conclusiveness) N.B- The value of the attributes unambiguity, credibility, completeness, and conclusiveness must be between 0 and 5 . If the user tries to set the value to an invalid number, choose the valid value that is closer to the argument. Constructors: Create two constructors for this class. See the signature of the constructors below: public Evidence (String description, byte type, byte unambiguity, byte credibility, byte completeness, byte conclusiveness) public Evidence (String description, byte unambiguity, byte credibility, byte completeness, byte conclusiveness) The constructors should instantiate the variables using the provided arguments and will compute the probability based on the weights and factors in the table above. For the second constructor, set the type to its default value and compute the probability of the evidence. Business rules: - The value of the above-mentioned factor needs to be between 0 and 5 . - The value of probability needs to be between 0 and 5 inclusively. - If the argument is outside of this range, choose the valid value that is closer to the argument. Other methods: You need to define the following methods: - public byte computeProbability(): This method can be used to compute the probability of an item of evidence. - public static String probability2String(byte probability): This method can be used to return the String representation of the probability level. Eg. For input =1, the function will return the String "Very Unlikely". For 0 or invalid input, the function returns "Extremely Unlikely". - public String toString(): This method can be called to return the object in a human-friendly manner. It needs to return the following information: Evidence: This is the description. Type of evidence: Real Evidence ** Probability: 3 likely - public String printFullDescription(): This method can be called to return the object in a human-friendly manner. It re-uses the toString() method described above and needs to return the following information: Evidence: This is the description. Type of evidence: Real Evidence Probability: 3 likely Evaluated based on those characteristics: > Unambiguity: 5 >> Credibility: 3 >> Completeness: 4 > Conclusiveness: 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is meant by Career Planning and development ?

Answered: 1 week ago

Question

What are Fringe Benefits ? List out some.

Answered: 1 week ago

Question

=+1 Is the decision fair to employees?

Answered: 1 week ago