Artificial Intelligence
Artificial Intelligence
Information

ChainingResult.ContradictoryConclusion property


      Returns the object of the class Conclusion which is contradictory.


Espace de noms : ielib
Assembly : ielib.dll

public Conclusion ContradictoryConclusion { get; }

Property value

Type : ielib.Conclusion

The object of the class Conclusion


      Note: Consultation with the ChainingResult.Result property to find out if the result is contradictory.

Example: Use the ChainingResult.Result property. Is it the result is a conclusion then it displays the result on the DataGridView control.


private void Run(InferenceEngine ie, DataGridView gv)
{
ChainingResult result = ie.Run();
Fact f;

switch(result.Result)
{
      case ChainingResult.ExecuteResult.Conclusion :
for (int i = 0; I < result.Count; i++)
      DisplayResult(result[i], gv.Rows.Add().Cells[1]);
      break;
      case ChainingResult.ExecuteResult.Question :
      AskUser(result.Question); // The question to the user
      break;
      case ChainingResult.ExecuteResult.Contradictory :
      TreatmentContradictory(result.Contradictory); // There is a contradiction
      break;
      default: // The system cannot find
      MessageBox.Show("I do not find.");
      break;
      }
}

private void DisplayResult(Fact f, DataGridViewCell cell)
{
      switch(f.Type)
      {
      case Fact.DataType.Bool :
      bool b = (bool)f.Value;
      cell.Value = b.ToString();
      break;
      case Fact.DataType.Real :
      double d = (double)f.Value;
      cell.Value = d.ToString() ;
      break;
      case Fact.DataType.Symbol :
      cell.Value = (string)f.Value;
      break;
      default: break;
      }
}