//Copyright (C) 2005 Richard J. Northedge
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
using System;
namespace BotSharp.MachineLearning
{
///
/// Object containing predicate data, where the parameters are matched to
/// the outcomes in an outcome pattern.
///
///
/// Richard J. Northedge
///
public class PatternedPredicate
{
private int mOutcomePattern;
private double[] mParameters;
private string mName;
///
/// Creates a PatternedPredicate object.
///
///
/// Index into the outcome pattern array, specifying which outcome pattern relates to
/// this predicate.
///
///
/// Array of parameters for this predicate.
///
protected internal PatternedPredicate(int outcomePattern, double[] parameters)
{
mOutcomePattern = outcomePattern;
mParameters = parameters;
}
///
/// Creates a PatternedPredicate object.
///
///
/// The predicate name.
///
///
/// Array of parameters for this predicate.
///
protected internal PatternedPredicate(string name, double[] parameters)
{
mName = name;
mParameters = parameters;
}
///
/// Index into array of outcome patterns.
///
public int OutcomePattern
{
get
{
return mOutcomePattern;
}
set // for trainer
{
mOutcomePattern = value;
}
}
///
/// Gets the value of a parameter from this predicate.
///
///
/// index into the parameter array.
///
///
public double GetParameter(int index)
{
return mParameters[index];
}
///
/// Number of parameters associated with this predicate.
///
public int ParameterCount
{
get
{
return mParameters.Length;
}
}
///
/// Name of the predicate.
///
public string Name
{
get
{
return mName;
}
set
{
mName = value;
}
}
}
}