public void GetProperties_With_Matrix(int id, int nodeCount, string networkAsString, bool asSymmetric)
        {
            var retriever = new NetworkPropertyRetrieverToPlainText();
            var net = MatrixHelper.GetMatrix(nodeCount, networkAsString, asSymmetric);

            string results = retriever.GetProperties(net);

            Assert.NotNull(results);
        }
        public void GetProperties(int id, string networkAsString)
        {
            var retriever = new NetworkPropertyRetrieverToPlainText();
            var net = BasicAdjListParser.ParseToNetwork(networkAsString, true, true);

            string results = retriever.GetProperties(net);

            Assert.NotNull(results);
        }
        public void GetProperties_With_Data_Attribs(int id, string networkAsString, int [] nodeAttribs, string[] edgeAttribs)
        {
            var retriever = new NetworkPropertyRetrieverToPlainText();
            var net = BasicAdjListParser.ParseToNetwork(networkAsString, true, true);
            net.NodeData.AddColumn("Col0", typeof (int));
            foreach (var node in net.Nodes)
            {
                net.NodeData.SetValue<int>(node, 0, nodeAttribs[node.Index]);
            }
            net.EdgeData.AddColumn("Colz", typeof(string));
            foreach (var edge in net.Edges)
            {
                net.EdgeData.SetValue<string>(edge, 0, edgeAttribs[edge.Index]);
            }

            string results = retriever.GetProperties(net);

            Assert.NotNull(results);
        }
Пример #4
0
 private void openWithRandomDataToolStripMenuItem2_Click(object sender, EventArgs e)
 {
     INetwork network = BasicAdjListGenerator.GenerateAdjListWithDataAttribs(5, 7, false, true, true);
     var retriever = new NetworkPropertyRetrieverToPlainText();
     var view = new NetworkPropertiesForm();
     view.SetPropertiesText(retriever.GetProperties(network));
     view.Show();
 }
Пример #5
0
 private void createNetworkToolStripMenuItem2_Click(object sender, EventArgs e)
 {
     var netForm = new NetGeneratorForm();
     var dialogResult = netForm.ShowDialog();
     if (dialogResult == DialogResult.OK)
     {
         var network = netForm.OutputNetwork;
         var retriever = new NetworkPropertyRetrieverToPlainText();
         var view = new NetworkPropertiesForm();
         view.SetPropertiesText(retriever.GetProperties(network));
         view.Show();
     }
 }
Пример #6
0
        public void Execute(IParamMgr paramMgr, IInputPortMgr inPortMgr, ICompoundSettingsMgr settings, IOutputPortMgr outPortMgr)
        {
            SetStatus(FxStatus.Validating, StatusChangeDriver.NormalTransition, "Beginning pre-execution validations.");

            if (paramMgr != null)
            {
                INetworkPropertiesElementParamMgr myParamMgr = paramMgr as INetworkPropertiesElementParamMgr;
                if (myParamMgr != null)
                {
                    #region Log

                    _Logger.Info("Execute() begin");
                    #endregion

                    // begin execution ------------------------------------------------
                    SetStatus(FxStatus.Executing, StatusChangeDriver.NormalTransition, "Beginning execution.");

                    //1) get the input network
                    IInputNetworkPort inPort = inPortMgr[0] as IInputNetworkPort;
                    var retriever = new NetworkPropertyRetrieverToPlainText();
                    Properties = retriever.GetProperties(inPort.InputNetwork);
                    // inform listeners that values/items at the core have been modified and to refesh the UI.
                    OnCoreModified(new CoreModifiedEventArgs(CoreActions.ModelInitialized));

                    // now set the input network as the item to be displaed in the secondary fx M
                }
                else
                    SetStatus(FxStatus.UnInitialized, StatusChangeDriver.ValidationFailure, "ParamMgr is not of type INetworkPropertiesElementParamMgr.");
            }
            else
            {
                SetStatus(FxStatus.UnInitialized, StatusChangeDriver.ValidationFailure, "ParamMgr is null.");
            }
        }