public Rule2(Csla.Core.IPropertyInfo primaryProperty) : base(primaryProperty) { IsAsync = true; _innerRule = new Rule1(primaryProperty); InputProperties = _innerRule.InputProperties; }
public Piece Run(PieceGrid currentGen, Point point, Piece piece) { Piece p1 = Rule1.Run(currentGen, point); Piece p2 = Rule2.Run(currentGen, point); return(p1.StateValue >= p2.StateValue ? p1 : p2); }
public Rule3(Csla.Core.IPropertyInfo primaryProperty) : base(primaryProperty) { IsAsync = true; _innerRule = new Rule1(primaryProperty); InputProperties = _innerRule.InputProperties; ProvideTargetWhenAsync = true; }
static void Main(string[] args) { Rule1 r1 = new Rule1(); r1.Check(); Rule2 r2 = new Rule2(); r2.Check(); }
/* CREATE */ public static void Add_Rule_1(int Id, int Major_Max, int Special_Major_Max) { var client = ConnectNeo4J.Connection(); var rule = new Rule1 { id = Id, major_max = Major_Max, special_major_max = Special_Major_Max, isDelete = false }; client.Cypher.Create("(:Rule_1 {rule})").WithParam("rule", rule).ExecuteWithoutResultsAsync().Wait(); }
public void When_conditions_is_false_then_action_should_not_be_executed() { Rule1.Setup(rule => rule.Evaluate(Facts)).Returns(false); Rules.Register(Rule1.Object); RulesEngine.Fire(Rules, Facts); Rule1.Verify(rule => rule.Execute(Facts), Times.Never); }
public override int GetHashCode() { var result = 0; result ^= Kind.GetHashCode(); result ^= Rule1.GetHashCode(); result ^= Rule2.GetHashCode(); result ^= Symbol.GetHashCode(); return(result); }
/* UPDATE */ public static void Update_Rule_1(int Id, int Major_Max, int Special_Major_Max) { var client = ConnectNeo4J.Connection(); var term = new Rule1 { id = Id, major_max = Major_Max, special_major_max = Special_Major_Max }; client.Cypher.Match("(a:Rule_1)") .Where((Rule1 item) => item.id == Id) .Set("a = {tmp}") .WithParam("tmp", term) .ExecuteWithoutResultsAsync(); }
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); }
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); } }
public bool PlayerWins(int posY, int posX, int palyerSide) { var playerWins = Rule1.Referee(posY, posX, palyerSide); return(playerWins); }
public bool ComputerWins(Tuple <int, int> nextMove, int aiSide) { var computerWins = Rule1.Referee(nextMove.Item1, nextMove.Item2, aiSide); return(computerWins); }
public bool MatchesAnyRule(int value) { return(Rule1.IsInRange(value) || Rule2.IsInRange(value)); }
public DefaultRulesEngineTests() { Rule1.Setup(rule => rule.Name).Returns("r"); }