public void Test_PositionChangeable()
        {
            ParticipantPosition pos = new ParticipantPosition(0, 0);
            Coordinate          start = new Coordinate(0, 0), end = new Coordinate(13, 44);

            Assert.AreEqual(start.X, pos.X);
            Assert.AreEqual(start.Y, pos.Y);

            pos.PosX = 13; pos.PosY = 44;

            Assert.AreEqual(end.X, pos.X);
            Assert.AreEqual(end.Y, pos.Y);
        }
Exemple #2
0
        /// <summary>
        /// Creates a new Participant.
        /// </summary>
        /// <param name="position">The initial position of this participant</param>
        /// <param name="maxSpeed">The max speed of this participant</param>
        /// <param name="accidentRisk">The risk that this participant causes an accident</param>
        /// <param name="size">The amount of space this participant uses up</param>
        protected Participant(StreetConnector position, double maxSpeed, double accidentRisk, double size)
        {
            id = NextID;
            currentConnector  = position;
            this.position     = ParticipantPosition.FromCoordinate(position.Coordinate);
            this.maxSpeed     = maxSpeed;
            this.accidentRisk = accidentRisk;
            this.size         = size;

            baseRoute           = null;
            specialRoute        = null;
            currentRoutingState = RoutingState.Idle;
            lastConnector       = null;
            nextConnector       = null;
            goalConnector       = null;
            timeBonus           = TimeSpan.Zero;
            claimedSpace        = false;
            isFirstClaim        = true;
        }