コード例 #1
0
        public void TestValidAutomataSingleNodeIsTrue()
        {
            BooleanNetworkValidator validator = new BooleanNetworkValidator();


            var automata = new GeneNode()
            {
                NodeName = "a",
            };

            var booleanNetwork = new List <GeneLink>()
            {
                new GeneLink()
                {
                    From = "A", To = "B", IsPositive = true
                },
                new GeneLink()
                {
                    From = "A", To = "C", IsPositive = true
                }
            }
            ;

            var res = validator.IsValidAutomata(automata, null, booleanNetwork);

            Assert.IsTrue(res);
        }
コード例 #2
0
        public void TestValidAutomataWithLoop()
        {
            BooleanNetworkValidator validator = new BooleanNetworkValidator();


            var automata = new GeneNode()
            {
                NodeName    = "a",
                Transitions = new List <GeneTransition>()
                {
                    new GeneTransition()
                    {
                        Condition = new Condition()
                        {
                            { "A", true }, { "B", true }, { "C", true }
                        },
                        Node = new GeneNode()
                        {
                            NodeName    = "b",
                            Transitions = new List <GeneTransition>()
                            {
                                new GeneTransition()
                                {
                                    Condition = new Condition()
                                    {
                                        { "A", true }, { "B", true }, { "C", true }
                                    },
                                    Node = null
                                }
                            }
                        }
                    }
                }
            };

            // set the loop
            automata.Transitions.First().Node = automata;

            var booleanNetwork = new List <GeneLink>()
            {
                new GeneLink()
                {
                    From = "A", To = "B", IsPositive = true
                },
                new GeneLink()
                {
                    From = "A", To = "C", IsPositive = true
                }
            }
            ;


            var res = validator.IsValidAutomata(automata, null, booleanNetwork);

            Assert.IsTrue(res);
        }
コード例 #3
0
        public void TestValidAutomataSimplePathIsTrue()
        {
            BooleanNetworkValidator validator = new BooleanNetworkValidator();


            var automata = new GeneNode()
            {
                NodeName    = "a",
                Transitions = new List <GeneTransition>()
                {
                    new GeneTransition()
                    {
                        Condition = new Condition()
                        {
                            { "A", true }, { "B", false }, { "C", false }
                        },
                        Node = new GeneNode()
                        {
                            NodeName    = "b",
                            Transitions = new List <GeneTransition>()
                            {
                                new GeneTransition()
                                {
                                    Condition = new Condition()
                                    {
                                        { "A", true }, { "B", true }, { "C", true }
                                    },
                                    Node = new GeneNode()
                                    {
                                        NodeName = "final"
                                    }
                                }
                            }
                        }
                    }
                }
            };

            var booleanNetwork = new List <GeneLink>()
            {
                new GeneLink()
                {
                    From = "A", To = "B", IsPositive = true
                },
                new GeneLink()
                {
                    From = "A", To = "C", IsPositive = true
                }
            }
            ;

            var res = validator.IsValidAutomata(automata, null, booleanNetwork);

            Assert.IsTrue(res);
        }