Exemplo n.º 1
0
            public NnModuleForm(
                NnModuleRecord record
                )
            {
                this.Type = record.Type;

                var options        = new List <Variable>();
                var defaultOptions = NnModule.GetDefaultOptions(record.Type);

                foreach (var item in defaultOptions)
                {
                    options.Add(
                        new Variable(
                            item.Key,
                            item.Value,
                            record.Options != null ?
                            (record.Options.ContainsKey(item.Key) ?
                             record.Options[item.Key] :
                             null) :
                            null
                            )
                        );
                }

                this.Options = options.ToImmutableList();
                this.Result  = record.Result;
            }
Exemplo n.º 2
0
 public NnModule Dummy(ImmutableDictionary <string, string> options) =>
 new NnModule(
     "(Module not implemented)",
     () => true,
     () => true,
     (CancellationToken ct, ImmutableDictionary <string, string> options) => true,
     () => "(none)",
     NnModule.GetDefaultOptions(ModuleType.Dummy));
Exemplo n.º 3
0
 public NnModule NnMainNonSC(ImmutableDictionary <string, string> options) =>
 new NnModule(
     "NN Main Non-SC",
     NnMainNonSCCanExecute,
     NnMainNonSCIsDone,
     NnMainNonSCExecute,
     NnMainNonSCGetResult,
     NnModule.GetDefaultOptions(ModuleType.NnMainNonSC),
     options);
Exemplo n.º 4
0
 public NnModule NnMain(ImmutableDictionary <string, string> options) =>
 new NnModule(
     "NN Main",
     () => true,
     NnMainIsDone,
     NnMainExecute,
     NnMainGetResult,
     NnModule.GetDefaultOptions(ModuleType.NnMain),
     options);
Exemplo n.º 5
0
            public NnModuleForm(
                ModuleType type
                )
            {
                this.Type = type;

                var options = new List <Variable>();

                foreach (var item in NnModule.GetDefaultOptions(type))
                {
                    options.Add(
                        new Variable(
                            item.Key,
                            item.Value,
                            null));
                }

                this.Options = options.ToImmutableList();
            }