Ejemplo n.º 1
0
        public void Generate_scp_scp_network_from_leave_out(Leave_out_class leave_out)
        {
            Dictionary <string, bool> scps_that_shall_not_be_connected_with_eachOther_dict = new Dictionary <string, bool>();

            if (!Options.Consider_scp_interactions_between_signaling_processes)
            {
                scps_that_shall_not_be_connected_with_eachOther_dict = Generate_dictionary_with_all_signaling_processes();
            }
            NetworkTable_line_class[] networkTable_lines = Generate_networkTable_lines(leave_out, scps_that_shall_not_be_connected_with_eachOther_dict);

            Scp_nw = new Network_class();
            Scp_nw.Add_from_networkTable_lines(networkTable_lines);
        }
Ejemplo n.º 2
0
        public void Generate(Network_class process_nw, Color_enum[] rotation_colors)
        {
            this.Process_nw = process_nw.Deep_copy();
            this.Process_nw.Transform_into_undirected_double_network();
            this.Rotation_colors              = rotation_colors;
            this.Rotation_colors_length       = this.Rotation_colors.Length;
            this.Already_considered_neighbors = new Dictionary <int, bool>();

            NodeIndex_colorIndex_dict = new Dictionary <int, int>();
            Color_lines_list          = new List <yed_node_color_line_class>();
            MBCO_obo_network_class mbc_obo_parent_child = new MBCO_obo_network_class();

            mbc_obo_parent_child.Generate_by_reading_safed_obo_file();
            ProcessName_siblingNames_dict = mbc_obo_parent_child.Get_processName_siblings_dictionary_if_direction_is_parent_child();
        }
Ejemplo n.º 3
0
        public Dictionary <string, string[]> Generate_scpNames_scpUnionNames_dict_with_indicated_numbers_of_combined_scps(int[] numbers_of_combined_scps, string[] consideredSCP_names)
        {
            consideredSCP_names = consideredSCP_names.Distinct().OrderBy(l => l).ToArray();
            Network_class scp_nw_considered = this.Scp_nw.Deep_copy();

            scp_nw_considered.Keep_only_input_nodeNames(consideredSCP_names);

            int nw_length = scp_nw_considered.NW_length;

            scp_nw_considered.Transform_into_undirected_double_network();
            scp_nw_considered.Nodes.Order_by_nw_index();
            Network_line_class        nw_line0;
            Network_line_class        nw_line1;
            Network_line_class        nw_line2;
            Network_line_class        nw_line3;
            Network_line_class        nw_line4;
            Network_line_class        nw_line5;
            Network_target_line_class nw_target1_line;
            Network_target_line_class nw_target2_line;
            Network_target_line_class nw_target3_line;
            Network_target_line_class nw_target4_line;
            Network_target_line_class nw_target5_line;
            int targets0_length;
            int targets1_length;
            int targets2_length;
            int targets3_length;
            int targets4_length;
            int targets5_length;
            NetworkNode_line_class        current_node_line;
            List <string[]>               all_target_processNames_list = new List <string[]>();
            Dictionary <string, string[]> scpNames_scpUnionNames_dict  = new Dictionary <string, string[]>();
            Dictionary <int, bool>        Included_nw_indexes          = new Dictionary <int, bool>();

            int numbers_of_combined_scps_length = numbers_of_combined_scps.Length;
            int number_of_combined_scps;

            for (int indexCombined = 0; indexCombined < numbers_of_combined_scps_length; indexCombined++)
            {
                number_of_combined_scps = numbers_of_combined_scps[indexCombined];
                string[] target_processNames = new string[number_of_combined_scps];
                for (int indexNW = 0; indexNW < nw_length; indexNW++)
                {
                    nw_line0 = scp_nw_considered.NW[indexNW];
                    Included_nw_indexes.Add(indexNW, true);
                    current_node_line      = scp_nw_considered.Nodes.Get_indexed_node_line_if_index_is_correct(indexNW);
                    target_processNames[0] = (string)current_node_line.Name.Clone();
                    targets0_length        = nw_line0.Targets_length;

                    #region Loop1
                    for (int indexT_process1 = 0; indexT_process1 < targets0_length; indexT_process1++)
                    {
                        nw_target1_line = nw_line0.Targets[indexT_process1];
                        if (!Included_nw_indexes.ContainsKey(nw_target1_line.NW_index))
                        {
                            Included_nw_indexes.Add(nw_target1_line.NW_index, true);
                            nw_line1               = scp_nw_considered.NW[nw_target1_line.NW_index];
                            current_node_line      = scp_nw_considered.Nodes.Get_indexed_node_line_if_index_is_correct(nw_target1_line.NW_index);
                            target_processNames[1] = (string)current_node_line.Name.Clone();
                            targets1_length        = nw_line1.Targets_length;
                            if (number_of_combined_scps == 2)
                            {
                                Add_scpNames_combination_to_dictionary(scpNames_scpUnionNames_dict, target_processNames);
                            }
                            else
                            {
                                #region Loop2
                                for (int indexT_process2 = 0; indexT_process2 < targets1_length; indexT_process2++)
                                {
                                    nw_target2_line = nw_line1.Targets[indexT_process2];
                                    if (!Included_nw_indexes.ContainsKey(nw_target2_line.NW_index))
                                    {
                                        Included_nw_indexes.Add(nw_target2_line.NW_index, true);
                                        nw_line2               = scp_nw_considered.NW[nw_target2_line.NW_index];
                                        current_node_line      = scp_nw_considered.Nodes.Get_indexed_node_line_if_index_is_correct(nw_target2_line.NW_index);
                                        target_processNames[2] = (string)current_node_line.Name.Clone();
                                        targets2_length        = nw_line2.Targets_length;
                                        if (number_of_combined_scps == 3)
                                        {
                                            Add_scpNames_combination_to_dictionary(scpNames_scpUnionNames_dict, target_processNames);
                                        }
                                        else
                                        {
                                            #region Loop3
                                            for (int indexT_process3 = 0; indexT_process3 < targets2_length; indexT_process3++)
                                            {
                                                nw_target3_line = nw_line2.Targets[indexT_process3];
                                                if (!Included_nw_indexes.ContainsKey(nw_target3_line.NW_index))
                                                {
                                                    Included_nw_indexes.Add(nw_target3_line.NW_index, true);
                                                    nw_line3               = scp_nw_considered.NW[nw_target3_line.NW_index];
                                                    current_node_line      = scp_nw_considered.Nodes.Get_indexed_node_line_if_index_is_correct(nw_target3_line.NW_index);
                                                    target_processNames[3] = (string)current_node_line.Name.Clone();
                                                    targets3_length        = nw_line3.Targets_length;
                                                    if (number_of_combined_scps == 4)
                                                    {
                                                        Add_scpNames_combination_to_dictionary(scpNames_scpUnionNames_dict, target_processNames);
                                                    }
                                                    else
                                                    {
                                                        #region Loop4
                                                        for (int indexT_process4 = 0; indexT_process4 < targets3_length; indexT_process4++)
                                                        {
                                                            nw_target4_line = nw_line3.Targets[indexT_process4];
                                                            if (!Included_nw_indexes.ContainsKey(nw_target4_line.NW_index))
                                                            {
                                                                Included_nw_indexes.Add(nw_target4_line.NW_index, true);
                                                                nw_line4               = scp_nw_considered.NW[nw_target4_line.NW_index];
                                                                current_node_line      = scp_nw_considered.Nodes.Get_indexed_node_line_if_index_is_correct(nw_target4_line.NW_index);
                                                                target_processNames[4] = (string)current_node_line.Name.Clone();
                                                                targets4_length        = nw_line4.Targets_length;
                                                                if (number_of_combined_scps == 5)
                                                                {
                                                                    Add_scpNames_combination_to_dictionary(scpNames_scpUnionNames_dict, target_processNames);
                                                                }
                                                                else
                                                                {
                                                                    #region Loop5
                                                                    for (int indexT_process5 = 0; indexT_process5 < targets4_length; indexT_process5++)
                                                                    {
                                                                        nw_target5_line        = nw_line4.Targets[indexT_process5];
                                                                        nw_line5               = scp_nw_considered.NW[nw_target5_line.NW_index];
                                                                        current_node_line      = scp_nw_considered.Nodes.Get_indexed_node_line_if_index_is_correct(nw_target5_line.NW_index);
                                                                        target_processNames[5] = (string)current_node_line.Name.Clone();
                                                                        targets5_length        = nw_line5.Targets_length;
                                                                        if (number_of_combined_scps == 6)
                                                                        {
                                                                            Add_scpNames_combination_to_dictionary(scpNames_scpUnionNames_dict, target_processNames);
                                                                        }
                                                                        else
                                                                        {
                                                                            throw new Exception();
                                                                        }
                                                                    }
                                                                    #endregion
                                                                }
                                                                Included_nw_indexes.Remove(nw_target4_line.NW_index);
                                                            }
                                                        }
                                                        #endregion
                                                    }
                                                    Included_nw_indexes.Remove(nw_target3_line.NW_index);
                                                }
                                            }
                                            #endregion
                                        }
                                        Included_nw_indexes.Remove(nw_target2_line.NW_index);
                                    }
                                }
                                #endregion
                            }
                            Included_nw_indexes.Remove(nw_target1_line.NW_index);
                        }
                    }
                    #endregion

                    Included_nw_indexes.Remove(indexNW);
                }
            }
            return(scpNames_scpUnionNames_dict);
        }