39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using Nocturnis.DataStructures.ConfigurableParameters;
|
|
using Nocturnis.Enigmos.Modules;
|
|
using Nocturnis.Enigmos.Modules.ComputationalModules;
|
|
using Nocturnis.GlobalManagement.Constants;
|
|
using Nocturnis.GlobalManagement.Providers;
|
|
|
|
namespace Enigmos.Modules.ComputationalModules.Binary;
|
|
|
|
public abstract partial class ComparisionModule : BinaryComputationalModule,
|
|
IParameterizedModule,
|
|
IDuplicateOutputModule,
|
|
IOperationModule
|
|
{
|
|
private IBoolParameter Greater { get; set; }
|
|
public HashSet<IConfigurableParameter> ConfigurableParameters { get; set; } = new();
|
|
|
|
public override void Init()
|
|
{
|
|
base.Init();
|
|
this.DataOutInit("Output",1);
|
|
this.SetInputType(DataTypeConstant.BaseDataTypes.Real);
|
|
this.SetOutputType(DataTypeConstant.BaseDataTypes.Real);
|
|
Greater = GlobalProvider.DataStructureProvider!.NewBoolParameter("Method", "gt", "lt", true);
|
|
ConfigurableParameters = new HashSet<IConfigurableParameter> { Greater };
|
|
PostInit();
|
|
}
|
|
|
|
|
|
public override void Define()
|
|
{
|
|
this.Define(
|
|
cache => (
|
|
!(Greater!.ParameterValue ^ (this.X(cache).Real > this.Y(cache).Real)),
|
|
DataTypeConstant.BaseDataTypes.Bit
|
|
)
|
|
);
|
|
}
|
|
|
|
} |