Beispiel #1
0
        /* CREATE */
        public static void Add_Rule_3(int Id, int Max_Subject)
        {
            var client = ConnectNeo4J.Connection();
            var rule   = new Rule3 {
                id = Id, max_subject = Max_Subject, isDelete = false
            };

            client.Cypher.Create("(:Rule_3 {rule})").WithParam("rule", rule).ExecuteWithoutResultsAsync().Wait();
        }
Beispiel #2
0
    private void PredatorBoidMovement(BoidBehaviour boid)
    {
        Vector3 component1, component2, component3;

        //component1 = Rule1.FindPointTowardsLocalMassCentre(boidList, boid, perciveDistance * 5);
        component3 = Rule3.MatchVelocityOfPercivedBoids(boidList, boid, perciveDistance * 5);

        boid.CurrentVelocity    = boid.CurrentVelocity + component3;
        boid.transform.position = boid.transform.position + boid.CurrentVelocity;
    }
Beispiel #3
0
        /* UPDATE */
        public static void Update_Rule_3(int Id, int Max_Subject)
        {
            var client = ConnectNeo4J.Connection();
            var term   = new Rule3 {
                id = Id, max_subject = Max_Subject
            };

            client.Cypher.Match("(a:Rule_3)")
            .Where((Rule3 item) => item.id == Id)
            .Set("a = {tmp}")
            .WithParam("tmp", term)
            .ExecuteWithoutResultsAsync();
        }
Beispiel #4
0
    private void StandardBoidMovement(BoidBehaviour boid)
    {
        Vector3 defaultMovement, component1, component2, component3, component4;

        component1 = Rule1.FindPointTowardsGlobalMassCentre(boidList, boid);
        component2 = TargetPoint.TowardsPoint(boid, targetPoint);
        component3 = Rule2.MoveAwayFromNearbyObjects(boidList, boid);
        component4 = Rule3.MatchVelocityOfPercivedBoids(boidList, boid, perciveDistance);

        /*
         * component1 = Rule1.FindPointTowardsLocalMassCentre(boidList, boid, perciveDistance);
         * component2 = Rule2.MoveAwayFromNearbyObjects(boidList, boid);
         * component3 = Rule3.MatchVelocityOfPercivedBoids(boidList, boid, perciveDistance);
         * componentHunted = RuleHunted.MoveAwayFromPredators(predatorList, boid);
         */

        boid.CurrentVelocity    = boid.CurrentVelocity + component1 + component2 + component3 + component4;
        boid.transform.position = boid.transform.position + boid.CurrentVelocity;
        //Debug.Log(boid.transform.position);
    }
Beispiel #5
0
        public void CallAllRules()
        {
            Rule1         rule1    = new Rule1();
            Rule2         rule2    = new Rule2();
            Rule3         rule3    = new Rule3();
            Rule4         rule4    = new Rule4();
            Rule5         rule5    = new Rule5();
            Rule6         rule6    = new Rule6();
            Rule7         rule7    = new Rule7();
            Rule8         rule8    = new Rule8();
            Rule9         rule9    = new Rule9();
            Rule10        rule10   = new Rule10();
            Rule11        rule11   = new Rule11();
            Rule12        rule12   = new Rule12();
            Rule13        rule13   = new Rule13();
            ReadExcelData readData = new ReadExcelData();

            readData.ReadFromExcelFile("");
            //calls all rules
            int total;

            foreach (var row in Records.records)
            {
                total  = 0;
                total += rule1.Evaluate(row).Score;
                total += rule2.Evaluate(row).Score;
                total += rule3.Evaluate(row).Score;
                total += rule4.Evaluate(row).Score;
                total += rule5.Evaluate(row).Score;
                total += rule6.Evaluate(row).Score;
                total += rule7.Evaluate(row).Score;
                total += rule8.Evaluate(row).Score;
                total += rule9.Evaluate(row).Score;
                total += rule10.Evaluate(row).Score;
                total += rule11.Evaluate(row).Score;
                total += rule12.Evaluate(row).Score;
                total += rule13.Evaluate(row).Score;
                /* call all rules here */
                Console.WriteLine("Total score: " + total);
            }
        }