public void TestInitialize() { //(eRod.GoalKeeper, 50, 145, 2, 0, 1, 230, 460, 355); _rodGoalKeaper.RodType.ReturnsForAnyArgs(eRod.GoalKeeper); _rodGoalKeaper.RodXCoordinate.ReturnsForAnyArgs(50); _rodGoalKeaper.MinSectorWidth.ReturnsForAnyArgs(145); _rodGoalKeaper.SectorFactor.ReturnsForAnyArgs(2); _rodGoalKeaper.PlayerDistance.ReturnsForAnyArgs(0); _rodGoalKeaper.PlayerCount.ReturnsForAnyArgs(1); _rodGoalKeaper.OffsetY.ReturnsForAnyArgs(230); _rodGoalKeaper.StopperDistance.ReturnsForAnyArgs(460); _rodGoalKeaper.BestEffort.ReturnsForAnyArgs(355); //(eRod.Midfield, 480, 145, 2, 15, 5, 25, 505, 120); _rodMidfield.RodType.ReturnsForAnyArgs(eRod.Midfield); _rodMidfield.RodXCoordinate.ReturnsForAnyArgs(480); _rodMidfield.MinSectorWidth.ReturnsForAnyArgs(145); _rodMidfield.SectorFactor.ReturnsForAnyArgs(2); _rodMidfield.PlayerDistance.ReturnsForAnyArgs(15); _rodMidfield.PlayerCount.ReturnsForAnyArgs(5); _rodMidfield.OffsetY.ReturnsForAnyArgs(25); _rodMidfield.StopperDistance.ReturnsForAnyArgs(505); _rodMidfield.BestEffort.ReturnsForAnyArgs(120); _testAsset = new DecisionHelper(ROD_Y_START, ROD_Y_END); }
/// <summary> /// Decision Tree Constructor for tree without Subtree /// </summary> /// <param name="decisionHelper">Decision Helper Instance [default is null then will be constructed using Configuration File]</param> /// <param name="ballRadius">Ball Radius in mm [default is -1 will be taken from Configuration File]</param> /// <param name="tableWidth">Table Width (Y Axe) in mm [default is -1 will be taken from Configuration File]</param> /// <param name="playerWidth">Player Width in mm [default is -1 will be taken from Configuration File]</param> public PartialDecisionTree(IDecisionHelper helper = null, int ballRadius = -1, int tableWidth = -1, int playerWidth = -1) :base(helper, ballRadius, tableWidth, playerWidth) { foreach(eRod rodType in Enum.GetValues(typeof(eRod))) { _sectorWatch.Add(rodType, null); } }
/// <summary> /// Decision Tree Constructor for tree without Subtree /// </summary> /// <param name="decisionHelper">Decision Helper Instance [default is null then will be constructed using Configuration File]</param> /// <param name="ballRadius">Ball Radius in mm [default is -1 will be taken from Configuration File]</param> /// <param name="tableWidth">Table Width (Y Axe) in mm [default is -1 will be taken from Configuration File]</param> /// <param name="playerWidth">Player Width in mm [default is -1 will be taken from Configuration File]</param> public DecisionTree(IDecisionHelper helper = null, int ballRadius = -1, int tableWidth = -1, int playerWidth = -1) { BALL_RADIUS = (ballRadius > 0) ? ballRadius : Configuration.Attributes.GetValue<int>(Configuration.Names.BALL_DIAMETR) / 2; TABLE_WIDTH = (tableWidth > 0) ? tableWidth : Configuration.Attributes.GetValue<int>(Configuration.Names.TABLE_WIDTH); PLAYER_WIDTH = (playerWidth > 0) ? playerWidth : Configuration.Attributes.GetValue<int>(Configuration.Names.KEY_PLAYER_WIDTH); if (helper != null) { _helper = helper; } else { int start = Configuration.Attributes.GetValue<int>(Configuration.Names.KEY_ROD_START_Y); int end = Configuration.Attributes.GetValue<int>(Configuration.Names.KEY_ROD_END_Y); _helper = new DecisionHelper(start, end); } }
/// <summary> /// Decision Tree Constructor for tree without Subtree /// </summary> /// <param name="decisionHelper">Decision Helper Instance [default is null then will be constructed using Configuration File]</param> /// <param name="ballRadius">Ball Radius in mm [default is -1 will be taken from Configuration File]</param> /// <param name="tableWidth">Table Width (Y Axe) in mm [default is -1 will be taken from Configuration File]</param> /// <param name="playerWidth">Player Width in mm [default is -1 will be taken from Configuration File]</param> public DecisionTree(IDecisionHelper helper = null, int ballRadius = -1, int tableWidth = -1, int playerWidth = -1) { BALL_RADIUS = (ballRadius > 0) ? ballRadius : Configuration.Attributes.GetValue <int>(Configuration.Names.BALL_DIAMETR) / 2; TABLE_WIDTH = (tableWidth > 0) ? tableWidth : Configuration.Attributes.GetValue <int>(Configuration.Names.TABLE_WIDTH); PLAYER_WIDTH = (playerWidth > 0) ? playerWidth : Configuration.Attributes.GetValue <int>(Configuration.Names.KEY_PLAYER_WIDTH); if (helper != null) { _helper = helper; } else { int start = Configuration.Attributes.GetValue <int>(Configuration.Names.KEY_ROD_START_Y); int end = Configuration.Attributes.GetValue <int>(Configuration.Names.KEY_ROD_END_Y); _helper = new DecisionHelper(start, end); } }
/// <summary> /// Decision Tree Constructor /// </summary> /// <param name="subtree">Decision Sub Tree</param> /// <param name="decisionHelper">Decision Helper [default is null then will be constructed using Configuration File]</param> /// <param name="ballRadius">Ball Radius in mm [default is -1 will be taken from Configuration File]</param> /// <param name="tableWidth">Table Width (Y Axe) in mm [default is -1 will be taken from Configuration File]</param> /// <param name="playerWidth">Player Width in mm [default is -1 will be taken from Configuration File]</param> public FullDecisionTree(IDecisionTree subtree, IDecisionHelper decisionHelper = null, int ballRadius = -1, int tableWidth = -1, int playerWidth = -1) : base(subtree, decisionHelper, ballRadius, tableWidth, playerWidth) { }
/// <summary> /// Decision Tree Constructor for Tree with a Subtree /// </summary> /// <param name="subTree">Decision Subtree</param> /// <param name="decisionHelper">Decision Helper Instance [default is null then will be constructed using Configuration File]</param> /// <param name="ballRadius">Ball Radius in mm [default is -1 will be taken from Configuration File]</param> /// <param name="tableWidth">Table Width (Y Axe) in mm [default is -1 will be taken from Configuration File]</param> /// <param name="playerWidth">Player Width in mm [default is -1 will be taken from Configuration File]</param> public DecisionTree(IDecisionTree subTree, IDecisionHelper helper = null, int ballRadius = -1, int tableWidth = -1, int playerWidth = -1) :this(helper, ballRadius, tableWidth, playerWidth) { _subTree = subTree; }
/// <summary> /// Decision Tree Constructor for tree without Subtree /// </summary> /// <param name="decisionHelper">Decision Helper Instance [default is null then will be constructed using Configuration File]</param> /// <param name="ballRadius">Ball Radius in mm [default is -1 will be taken from Configuration File]</param> /// <param name="tableWidth">Table Width (Y Axe) in mm [default is -1 will be taken from Configuration File]</param> /// <param name="playerWidth">Player Width in mm [default is -1 will be taken from Configuration File]</param> public PartialDecisionTree(IDecisionHelper helper = null, int ballRadius = -1, int tableWidth = -1, int playerWidth = -1) : base(helper, ballRadius, tableWidth, playerWidth) { }
/// <summary> /// Decision Tree Constructor for Tree with a Subtree /// </summary> /// <param name="subTree">Decision Subtree</param> /// <param name="decisionHelper">Decision Helper Instance [default is null then will be constructed using Configuration File]</param> /// <param name="ballRadius">Ball Radius in mm [default is -1 will be taken from Configuration File]</param> /// <param name="tableWidth">Table Width (Y Axe) in mm [default is -1 will be taken from Configuration File]</param> /// <param name="playerWidth">Player Width in mm [default is -1 will be taken from Configuration File]</param> public DecisionTree(IDecisionTree subTree, IDecisionHelper helper = null, int ballRadius = -1, int tableWidth = -1, int playerWidth = -1) : this(helper, ballRadius, tableWidth, playerWidth) { _subTree = subTree; }