Exemple #1
0
            public NetworkLayoutRecord(
                BayesianNetwork network,
                NetworkLayout layout,
                NetworkLayoutOptions options)
            {
                Debug.Assert(options != null, "Layout options cannot be null.");

                this.Network       = network;
                this.NetworkLayout = layout;
                this.Options       = options;

                // Manually specify sizes.
                Dictionary <string, float> sizes = new Dictionary <string, float>();

                foreach (var v in network.Variables)
                {
                    sizes[v.Key] = Workbench.NetworkLayoutVertexSizeNormal;
                }

                // Instantiate algorithm.
                AlgorithmState = new LayoutAlgorithm(network.Clone(), sizes, options);

                // Copy existing positions over.
                if (layout != null && layout.Positions != null && layout.Positions.Count > 0)
                {
                    foreach (var kvp in layout.Positions)
                    {
                        AlgorithmState.Positions[kvp.Key] = kvp.Value;
                    }
                }
            }
Exemple #2
0
            public NetworkLayoutRecord(
                BayesianNetwork network,
                NetworkLayout existingLayout,
                IList <string> interestVertices,
                NetworkLayoutOptions options)
            {
                Debug.Assert(options != null, "Layout options cannot be null.");

                this.Network          = network;
                this.NetworkLayout    = existingLayout;
                this.InterestVertices = interestVertices.ToList();
                this.Options          = options;

                // Manually specify sizes.
                Dictionary <string, float> sizes = new Dictionary <string, float>();

                foreach (var v in network.Variables)
                {
                    if (!interestVertices.Contains(v.Key))
                    {
                        sizes[v.Key] = Workbench.NetworkLayoutVertexSizeMinimized;
                    }
                    else
                    {
                        sizes[v.Key] = Workbench.NetworkLayoutVertexSizeNormal;
                    }
                }

                this.AlgorithmState = new LayoutAlgorithm(network.Clone(), sizes, options);

                // Copy existing positions over.
                if (existingLayout != null && existingLayout.Positions != null && existingLayout.Positions.Count > 0)
                {
                    foreach (var kvp in existingLayout.Positions)
                    {
                        AlgorithmState.Positions[kvp.Key] = kvp.Value;
                    }
                }
            }
Exemple #3
0
            public NetworkLayoutRecord(
                BayesianNetwork network,
                NetworkLayout existingLayout,
                IList<string> interestVertices,
                NetworkLayoutOptions options)
            {
                Debug.Assert(options != null, "Layout options cannot be null.");

                this.Network = network;
                this.NetworkLayout = existingLayout;
                this.InterestVertices = interestVertices.ToList();
                this.Options = options;

                // Manually specify sizes.
                Dictionary<string, float> sizes = new Dictionary<string, float>();
                foreach (var v in network.Variables)
                {
                    if (!interestVertices.Contains(v.Key))
                    {
                        sizes[v.Key] = Workbench.NetworkLayoutVertexSizeMinimized;
                    }
                    else
                    {
                        sizes[v.Key] = Workbench.NetworkLayoutVertexSizeNormal;
                    }
                }

                this.AlgorithmState = new LayoutAlgorithm(network.Clone(), sizes, options);

                // Copy existing positions over.
                if (existingLayout != null && existingLayout.Positions != null && existingLayout.Positions.Count > 0)
                {
                    foreach (var kvp in existingLayout.Positions)
                    {
                        AlgorithmState.Positions[kvp.Key] = kvp.Value;
                    }
                }
            }
Exemple #4
0
            public NetworkLayoutRecord(
                BayesianNetwork network,
                NetworkLayout layout,
                NetworkLayoutOptions options)
            {
                Debug.Assert(options != null, "Layout options cannot be null.");

                this.Network = network;
                this.NetworkLayout = layout;
                this.Options = options;

                // Manually specify sizes.
                Dictionary<string, float> sizes = new Dictionary<string, float>();
                foreach (var v in network.Variables)
                {
                    sizes[v.Key] = Workbench.NetworkLayoutVertexSizeNormal;
                }

                // Instantiate algorithm.
                AlgorithmState = new LayoutAlgorithm(network.Clone(), sizes, options);

                // Copy existing positions over.
                if (layout != null && layout.Positions != null && layout.Positions.Count > 0)
                {
                    foreach (var kvp in layout.Positions)
                    {
                        AlgorithmState.Positions[kvp.Key] = kvp.Value;
                    }
                }
            }