mirror of
https://github.com/furyfire/trueskill.git
synced 2025-01-16 01:47:39 +00:00
Removed references to a Variable's factory from Variable itself. They were used early on in debugging.
This commit is contained in:
@ -5,15 +5,11 @@ namespace Moserware.Skills.FactorGraphs
|
|||||||
public class Variable<TValue>
|
public class Variable<TValue>
|
||||||
{
|
{
|
||||||
private readonly string _Name;
|
private readonly string _Name;
|
||||||
private readonly VariableFactory<TValue> _ParentFactory;
|
|
||||||
private readonly TValue _Prior;
|
private readonly TValue _Prior;
|
||||||
private int _ParentIndex;
|
|
||||||
|
|
||||||
public Variable(string name, VariableFactory<TValue> parentFactory, int parentIndex, TValue prior)
|
public Variable(string name, TValue prior)
|
||||||
{
|
{
|
||||||
_Name = "Variable[" + name + "]";
|
_Name = "Variable[" + name + "]";
|
||||||
_ParentFactory = parentFactory;
|
|
||||||
_ParentIndex = parentIndex;
|
|
||||||
_Prior = prior;
|
_Prior = prior;
|
||||||
ResetToPrior();
|
ResetToPrior();
|
||||||
}
|
}
|
||||||
@ -34,7 +30,7 @@ namespace Moserware.Skills.FactorGraphs
|
|||||||
public class DefaultVariable<TValue> : Variable<TValue>
|
public class DefaultVariable<TValue> : Variable<TValue>
|
||||||
{
|
{
|
||||||
public DefaultVariable()
|
public DefaultVariable()
|
||||||
: base("Default", null, 0, default(TValue))
|
: base("Default", default(TValue))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +44,7 @@ namespace Moserware.Skills.FactorGraphs
|
|||||||
public class KeyedVariable<TKey, TValue> : Variable<TValue>
|
public class KeyedVariable<TKey, TValue> : Variable<TValue>
|
||||||
{
|
{
|
||||||
public KeyedVariable(TKey key, string name, VariableFactory<TValue> parentFactory, int parentIndex, TValue prior)
|
public KeyedVariable(TKey key, string name, VariableFactory<TValue> parentFactory, int parentIndex, TValue prior)
|
||||||
: base(name, parentFactory, parentIndex, prior)
|
: base(name, prior)
|
||||||
{
|
{
|
||||||
Key = key;
|
Key = key;
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,7 @@ namespace Moserware.Skills.FactorGraphs
|
|||||||
public Variable<TValue> CreateBasicVariable(string nameFormat, params object[] args)
|
public Variable<TValue> CreateBasicVariable(string nameFormat, params object[] args)
|
||||||
{
|
{
|
||||||
var newVar = new Variable<TValue>(
|
var newVar = new Variable<TValue>(
|
||||||
String.Format(nameFormat, args),
|
String.Format(nameFormat, args),
|
||||||
this,
|
|
||||||
_CreatedVariables.Count,
|
|
||||||
_VariablePriorInitializer());
|
_VariablePriorInitializer());
|
||||||
|
|
||||||
_CreatedVariables.Add(newVar);
|
_CreatedVariables.Add(newVar);
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user