public static string TruckSpecificInfo(ITruck truck)
        {
            var sb = new StringBuilder();

            sb.AppendLine($"  Weight Capacity: {truck.WeightCapacity}t");
            return(sb.ToString().TrimEnd());
        }
Exemple #2
0
        public void TruckConstructorTest()
        {
            ITruck b = _truck;

            Assert.IsNotNull(b, "Error initializing the object with the Default Instance (See Singleton)");
            Assert.IsInstanceOfType(b, typeof(Truck));
            Assert.AreSame(_truck, b, "Object must be the same istance, Check if object has been instanciated correctly");
        }
Exemple #3
0
 public Route(List <Cargo> arrayPoints, ITruck truck)
 {
     _arrayPoints    = arrayPoints;
     _truck          = truck;
     _qPointsOfRoute = arrayPoints.Count() + 1;
     a = CreatePermutationArr();//инициализация массив перебора
     _bestCombinationArray = new List <List <Cargo> >();
 }
        public static void Main()
        {
            FactoryEnum     selectedFactory = (FactoryEnum)Enum.Parse(typeof(FactoryEnum), Console.ReadLine());
            IVehicleFactory factory         = GetFactory(selectedFactory);
            ICar            car             = factory.GetCar();

            Console.WriteLine(car.Type());
            ITruck truck = factory.GetTruck();

            Console.WriteLine(truck.Type());
        }
        private void setTruck(ITruck i_Truck)
        {
            i_Truck.IsCooled = GetCooled().Equals("1");
            float volumeOfCargo = -1;

            while (volumeOfCargo <= 0)
            {
                volumeOfCargo = float.Parse(GetVolumeOfCargo());
            }

            i_Truck.VolumeOfCargo = volumeOfCargo;
        }
        public async Task <IActionResult> TruckHistories(int id)
        {
            try
            {
                ITruck result = (ITruck)await administrator.TruckHistrories(id);

                return(Ok(result as ITruck));
            }
            catch (System.Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
        public void SetUp()
        {
            _truck = A.Fake <ITruck>();
            _plant = A.Fake <IPlant>();

            _currentCapacity = 0;
            _availablePlant  = PlantType.Reutov;
            _driveInfos      = new List <DriveInfo>();
            A.CallTo(() => _truck.GetCapacity()).ReturnsLazily(() => _currentCapacity);
            A.CallTo(() => _truck.GetAvaliablePlant()).ReturnsLazily(() => _availablePlant);
            A.CallTo(() => _truck.DriveToPlant(A <DriveInfo> .Ignored)).
            Invokes((DriveInfo driveInfo) =>
                    _driveInfos.Add(driveInfo));
        }
Exemple #8
0
        public ITruck GetReadyTruck()
        {
            ITruck     departing     = this.Truck;
            IContainer ore_container = this.ProductsToShip.First();

            ore_container.AddContent(ore_container.MaxCapacity - ore_container.CurrentAmount);

            departing.AddContainer(ore_container);

            if (this.Truck == null)
            {
                return(new Truck(new Vector2(200, 200), truckTexure, oreContainer));
            }
            return(null);
        }
Exemple #9
0
        public Ikea(Vector2 position, Texture2D truck_texture, Texture2D mine, Texture2D ore_box, Texture2D ore_container)
        {
            processes         = new List <IStateMachine>();
            ProductsToShip    = new List <IContainer>();
            this.mine         = mine;
            this.truckTexture = truck_texture;
            this.oreContainer = ore_container;
            this.oreBox       = ore_box;
            this.position     = position;
            waitingTruck      = new Truck(truckTexture, null, position + new Vector2(-100, 30), new Vector2(1, 0));

            processes.Add(
                new Repeat(new Seq(new Timer(1.0f),
                                   new Call(new AddOreBoxToMine(this)))));
        }
        public Ikea(Vector2 position, Texture2D truck_texture, Texture2D ikea, Texture2D product_box, Texture2D ore_container)
        {
            processes = new List<IStateMachine>();
            ProductsToShip = new List<IContainer>();
            this.ikea = ikea;
            this.truckTexture = truck_texture;
            this.oreContainer = ore_container;
            this.product_box = product_box;
            this.position = position;

            ITruck newTruck = new Truck (new Vector2(position.X -150, position.Y + 15), new Vector2(-50, 0), truckTexture);
            this.waitingTruck = newTruck;

            processes.Add(
                new Repeat(new Seq(new Timer(1.0f),
                    new Call(new AddOreBoxToMine(this)))));
        }
Exemple #11
0
        public async Task <IActionResult> AddTruck(Truck truck)
        {
            try
            {
                var adminUser = await Request.GetUser();

                var company = await adminUser.GetCompany();

                truck.CompanyId = company.Id;
                ITruck result = await administrator.AddNewTruck(truck);

                return(Ok(result));
            }
            catch (System.Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Exemple #12
0
        public IkeaFactory(Vector2 position, Texture2D truck_texture, Texture2D ikea, Texture2D product_box, Texture2D product_container)
        {
            this.truckTexture     = truck_texture;
            processes             = new List <IStateMachine>();
            ProductsToShip        = new List <IContainer>();
            this.ikea             = ikea;
            this.productContainer = product_container;
            this.productBox       = product_box;
            this.position         = position;

            waitingTruck = new Volvo(truck_texture, Position + Vector2.UnitX * -160, Vector2.UnitX * -80);

            processes.Add(
                new Repeat(new Seq(new Timer(1.0f),
                                   new Call(new AddProductBoxToIkea(this)))));
            //TODO: DECOMMENT WHEN ALL CLASSES CORRECTLY FILLED IN
            processes.Add(
                new Repeat(new Seq(new Wait(() => ProductsToShip.Count > 3),
                                   new Seq(new Call(new AddProductContainerToTruck(this)),
                                           new Seq(new Call(new RemoveTruckFromIkea(this)),
                                                   new Seq(new Timer(1.0f),
                                                           new Call(new AddTruckToIkea(this))))))));
        }
Exemple #13
0
        public Ikea(Vector2 position, Texture2D truck_texture, Texture2D ikea, Texture2D product_box, Texture2D product_container)
        {
            processes             = new List <IStateMachine>();
            ProductsToShip        = new List <IContainer>();
            this.ikea             = ikea;
            this.truckTexture     = truck_texture;
            this.ProductContainer = product_container;
            this.productBox       = product_box;
            this.position         = position;
            this.waitingTruck     = null;

            processes.Add(
                new Repeat(new Seq(new Timer(1.0f),
                                   new Call(new AddProductBoxtoIkea(this)))));



            processes.Add(new Repeat(new Seq(new Wait(() => ProductsToShip.Count == 0),
                                             new Seq(new Timer(1.0f), new CallAction(() => waitingTruck = new Truck(null, Position + new Vector2(100, 30), new Vector2(0, 0), truckTexture))))));

            processes.Add(new Repeat(new Seq(new Wait(() => ProductsToShip.Count == 3),
                                             new Seq(new Timer(1.0f), new CallAction(() => waitingTruck.AddContainer(new Ore(0, ProductContainer)))))));
        }
Exemple #14
0
        public Mine(Vector2 position, Texture2D truck_texture, Texture2D mine, Texture2D ore_box, Texture2D ore_container)
        {
            processes         = new List <IStateMachine>();
            ProductsToShip    = new List <IContainer>();
            this.mine         = mine;
            this.truckTexture = truck_texture;
            this.oreContainer = ore_container;
            this.oreBox       = ore_box;
            this.position     = position;
            this.waitingTruck = null;

            processes.Add(
                new Repeat(new Seq(new Timer(1.0f),
                                   new Call(new AddOreBoxToMine(this)))));



            processes.Add(new Repeat(new Seq(new Wait(() => ProductsToShip.Count == 0),
                                             new Seq(new Timer(1.0f), new CallAction(() => waitingTruck = new Truck(null, Position + new Vector2(100, 30), new Vector2(0, 0), truckTexture))))));

            processes.Add(new Repeat(new Seq(new Wait(() => ProductsToShip.Count == 3),
                                             new Seq(new Timer(1.0f), new CallAction(() => waitingTruck.AddContainer(new Ore(0, oreContainer)))))));
        }
Exemple #15
0
 public ITruck InsertTruck(ITruck truck, int sector, int placeNumber, DateTime startTime)
 {
     throw new NotImplementedException();
 }
 public CarbagePolygon(ITruck truck, IPlant plant)
 {
     _truck = truck;
     _plant = plant;
 }
 public void SetTruck(ITruck truck)
 {
     truckType = truck;
 }
Exemple #18
0
 public Builder(List <Cargo> arrayPoints, ITruck truck)
 {
     _arrayPoints          = arrayPoints;
     _truck                = truck;
     _bestCombinationArray = new List <List <Cargo> >();
 }
Exemple #19
0
 public void Init()
 {
     _truck = new Truck("Iveco", Shared.Options.SerializationOption.JSON);
 }
Exemple #20
0
 public void Init()
 {
     _truck = new Truck("Iveco");
 }
Exemple #21
0
 public Genetic(List <Cargo> arrayPoints, ITruck truck) : base(arrayPoints, truck)
 {
 }
Exemple #22
0
 public void Init()
 {
     _truck = new Truck("Iveco");
 }
Exemple #23
0
 public BruteForce(List <Cargo> arrayPoints, ITruck truck) : base(arrayPoints, truck)
 {
     _qPointsOfRoute = arrayPoints.Count() + 1;
     a = CreatePermutationArr();//инициализация массив перебора
 }
Exemple #24
0
    public IkeaFactory(Vector2 position, Texture2D truck_texture, Texture2D ikea, Texture2D product_box, Texture2D product_container)
    {
      this.truckTexture = truck_texture;
      processes = new List<IStateMachine>();
      ProductsToShip = new List<IContainer>();
      this.ikea = ikea;
      this.productContainer = product_container;
      this.productBox = product_box;
      this.position = position;

      waitingTruck = new Volvo(truck_texture, Position + Vector2.UnitX * -160, Vector2.UnitX * -80);

      processes.Add(
                    new Repeat(new Seq(new Timer(1.0f),
                                       new Call(new AddProductBoxToIkea(this)))));
            //TODO: DECOMMENT WHEN ALL CLASSES CORRECTLY FILLED IN
            processes.Add(
              new Repeat(new Seq(new Wait(() => ProductsToShip.Count > 3),
                                 new Seq(new Call(new AddProductContainerToTruck(this)),
                                 new Seq(new Call(new RemoveTruckFromIkea(this)),
                                 new Seq(new Timer(1.0f),
                                 new Call(new AddTruckToIkea(this))))))));


        }
Exemple #25
0
 public void CreateTruck(ITruck truck)
 {
     this.truck = truck;
 }
Exemple #26
0
 public Dijkstra(List <Cargo> arrayPoints, ITruck truck) : base(arrayPoints, truck)
 {
 }
        public ITruck GetReadyTruck()
        {
            IContainer _container = new Container (100, 200, new Vector2(position.X - 80, position.Y + 15), oreContainer);
            ITruck readyTruck = this.waitingTruck;
            waitingTruck.AddContainer (_container);

            ITruck newTruck = new Truck (new Vector2(position.X -150, position.Y + 15), new Vector2(-50, 0), truckTexture);
            waitingTruck = newTruck;

            return readyTruck;
        }
Exemple #28
0
 public Lexographic(List <Cargo> arrayPoints, ITruck truck) : base(arrayPoints, truck)
 {
 }