public WorkflowGlobal(string name, string description, List <Data> modelDataInputs, List <Data> modelDataOutputs, List <WorkflowComponent> components,
                              List <WorkflowComponent> scheduledComponents, List <ISolver> solvers, bool isAuxiliary = true, string scheduleMode = "", string parentName = "")
            : base(name, description, modelDataInputs, modelDataOutputs, components, scheduledComponents, isAuxiliary, scheduleMode, parentName)
        {
            List <Data> allData = ScheduledComponents.GetAllData();

            ScheduledComponents.GetInputsOutputsStatus(allData, out List <Data> defaultInputs, out List <Data> defaultOutputs);

            var outputsHash = new HashSet <string>(ModelDataOutputs.Select(d => d.Id));

            foreach (Data dt in defaultInputs)
            {
                if (outputsHash.Contains(dt.Id))
                {
                    ReversedInputs.Add(dt);
                }
            }

            var inputsHash = new HashSet <string>(ModelDataInputs.Select(d => d.Id));

            foreach (Data dt in defaultOutputs)
            {
                if (inputsHash.Contains(dt.Id))
                {
                    ReversedOutputs.Add(dt);
                }
            }

            Solvers = solvers;
        }
Beispiel #2
0
        public WorkflowReversedModel(string name, string description, List <Data> modelDataInputs, List <Data> modelDataOutputs, Model model, List <ISolver> solvers, string parentName = "")
            : base(name, description, modelDataInputs, modelDataOutputs, new List <WorkflowComponent>() { model }, new List <WorkflowComponent>() { model }, true, parentName)
        {
            //this.Model = model;

            var outputsHash = new HashSet <string>(ModelDataOutputs.Select(d => d.Id));

            foreach (Data dt in model.ModelDataInputs)
            {
                if (outputsHash.Contains(dt.Id))
                {
                    ReversedInputs.Add(dt);
                }
            }

            var inputsHash = new HashSet <string>(ModelDataInputs.Select(d => d.Id));

            foreach (Data dt in model.ModelDataOutputs)
            {
                if (inputsHash.Contains(dt.Id))
                {
                    ReversedOutputs.Add(dt);
                }
            }

            Solvers = solvers;
        }