I am trying to implement a C# interface in IronPython but am having some trouble. I've done this before with another C# interface but have come across another one which I've not been able to resolve how to subclass in IronPython to use it successfully, here it is:
The C# interface that I want to implement in IronPython:
using System;
namespace Accord.Math.Random
{
public interface IRandomNumberGenerator
{
float Mean
{
get;
}
float Variance
{
get;
}
float Next();
void SetSeed(int seed);
}
}
Here is what I have done before successfully in the past:
C# interface to implement
using System;
namespace Accord.Genetic
{
public interface IFitnessFunction
{
double Evaluate(IChromosome chromosome);
}
}
IronPython implementation:
class FitnessFunction(AG.IFitnessFunction):
def Evaluate(self, chromosome):
#some fitness calculation using chromosome
return Fitness
Any help would be so much appreciated!