JSMSolver 1.0.0-alpha1

This is a prerelease version of JSMSolver.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package JSMSolver --version 1.0.0-alpha1
NuGet\Install-Package JSMSolver -Version 1.0.0-alpha1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JSMSolver" Version="1.0.0-alpha1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JSMSolver --version 1.0.0-alpha1
#r "nuget: JSMSolver, 1.0.0-alpha1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install JSMSolver as a Cake Addin
#addin nuget:?package=JSMSolver&version=1.0.0-alpha1&prerelease

// Install JSMSolver as a Cake Tool
#tool nuget:?package=JSMSolver&version=1.0.0-alpha1&prerelease
 public ISolver Create<T1, T2>(IEnumerable<T2> data, IEnumerable<T2> obl = null, int[] prs = null) where T2 : JSMDataBase<T1>
        {
            JSMSolver.Solver<T1, T2> solv = new JSMSolver.Solver<T1, T2>();
            solv.Data[Signs.Plus] = new ReadOnlyCollection<T2>(data.Where(d => d.Sign == Signs.Plus).ToArray());
            solv.Data[Signs.Minus] = new ReadOnlyCollection<T2>(data.Where(d => d.Sign == Signs.Minus).ToArray());
            solv.Data[Signs.Tau] = new ReadOnlyCollection<T2>(data.Where(d => d.Sign == Signs.Tau).ToArray());
            solv.Data[Signs.Null] = new ReadOnlyCollection<T2>(data.Where(d => d.Sign == Signs.Null).ToArray());

            if (obl != null)
                solv.ObligatoryObjects = new ReadOnlyCollection<T2>(obl.ToArray());
            else
                solv.ObligatoryObjects = new ReadOnlyCollection<T2>(new T2[0]);

            solv.Filters = new Dictionary<Signs, Func<Hypothesis<T1, T2>, bool>>()
                {
                    { Signs.Plus, h => true },
                    { Signs.Minus, h => true }
                };

            solv.PropsF = prs;
            return solv;
        }

        private IEnumerable<JSMBase.JSMBase> CreateTestData()
        {
            PropInfo pi1 = new PropInfo() { Index = 1, Name = "Test1", Type = PropTypes.Value, Values = new List<TupleEx<int, string>>() { TupleEx.Create(0, "Var1"), TupleEx.Create(0, "Var2") } };
            PropInfo pi2 = new PropInfo() { Index = 1, Name = "Test2", Type = PropTypes.Value, Values = new List<TupleEx<int, string>>() { TupleEx.Create(0, "Var1"), TupleEx.Create(0, "Var2") } };

            JSMMedicine.Infos = new JSMStructure() { pi1, pi2 };
            JSMMedicine o1 = new JSMMedicine(1, "1") { Data = new PropData[] { new PropData(pi1, "+t"), new PropData(pi2, "tt") } };
            JSMMedicine o2 = new JSMMedicine(2, "2") { Data = new PropData[] { new PropData(pi1, "+t"), new PropData(pi2, "+t") } };
            JSMBase.JSMBase ex1 = new JSMBase.JSMBase(o1);
            ex1.ConvertToBitArray();
            ex1.Sign = Signs.Minus;

            JSMBase.JSMBase ex2 = new JSMBase.JSMBase(o2);
            ex2.ConvertToBitArray();
            ex2.Sign = Signs.Minus;

            return new JSMBase.JSMBase[] { ex1, ex2 };
        }

        public async Task Main()
        {
            
            //Create an example
            ISolver solv = Create<JSMMedicine, JSMBase.JSMBase>(CreateTestData());
            //Init - parameters
            Dictionary<Signs, IEnumerable<IReasoningType>> d = new Dictionary<Signs, IEnumerable<IReasoningType>>();
            var cdPlus = new CompareData(CompareOperator.LessOrEquals, 2);
            var cdMn = new CompareData(CompareOperator.LessOrEquals, 2);
            Addings plAddings = Addings.Simple;
            Addings mnAddings = Addings.Simple;
            solv.Init(cdPlus, cdMn, null, null, plAddings, mnAddings, d, true);
            //Count
            Progress<int> pr = new Progress<int>(i => { });
            CancellationToken ct = CancellationToken.None;
            await solv.JSMSimple(ct, pr);

            //List of cause hypotheses
            IList lst = solv.Hypotheses[Signs.Minus];
            //List of prediction hypotheses
            IList preds = solv.Predictions[Signs.Minus];
        }
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on JSMSolver:

Package Downloads
JSMSolver.Research

Classes for research (JSM-method ARS)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1-beta1 147 10/6/2021
1.0.0-alpha1 391 9/15/2020