Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Optimizer.Domain.Bus;
- using Optimizer.Domain.Bus.Entities;
- using Optimizer.Domain.Bus.ValueObjects;
- using Optimizer.Domain.Route;
- using Optimizer.Domain.Route.ValueObjects;
- using Optimizer.PathMaker.RouteMaker;
- using Optimizer.PathMaker.Randomizer;
- using System.Net.Http.Headers;
- using Optimizer.Domain.Common.Entities;
- /*var bus = Bus.Create(100, PlateNumber.Create("asd"));
- var busStation = BusStation.Create("Station1");
- var arrivalTimes = new List<ArrivalTime> { ArrivalTime.Create(busStation, DateTime.UtcNow) };
- var route = Route<Bus, BusId>.Create(bus, arrivalTimes);
- bus.AddRoute(route);*/
- internal class Program
- {
- private static void Main(string[] args)
- {
- Random random = new Random();
- var bus = Bus.Create(random.Next(50, 100), PlateNumber.Create("AB" + random.Next(1000, 9999)));
- var station = BusStation.Create("Station" + random.Next(1, 10));
- List<ArrivalTime> arrivalTimes = new List<ArrivalTime>();
- for (int i = 0; i < 6; i++)
- {
- DateTime time = new DateTime(random.Next(2024,2024), random.Next(1,12), random.Next(1, 31), random.Next(0, 12), random.Next(0, 60), random.Next(0, 60));
- arrivalTimes.Add(ArrivalTime.Create(station, time));
- }
- var route = Route<Bus, BusId>.Create(bus, arrivalTimes);
- // Вывод сгенерированных данных
- Console.WriteLine("Сгенерированный автобус Максимальное количество пассажиров - " + bus.MaxPassengersCount + ", Номер - " + bus.PlateNumber.Number);
- Console.WriteLine("Сгенерированная остановка Название - " + station.StationName);
- Console.WriteLine("Времена прибытия:");
- foreach (var time in route.ArrivalTimes)
- {
- Console.WriteLine(time.Time);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement