Exemple #1
0
 public ItalyTravel(BookingDatabase bookingDb, OysterDatabase oysterDb, ShutterStockDatabase shutterStockDb, TripAdvisorDatabase tripAdvisorDb)
 {
     bookingIterator      = new BookingIterator(bookingDb);
     oysterIterator       = new OysterIterator(oysterDb);
     shutterStockIterator = new ShutterStockIterator(shutterStockDb);
     tripAdvisorIterator  = new TripAdvisorIterator(tripAdvisorDb);
 }
 public FranceTravelAgency(Random rd, ShutterStockDatabase photoDatabase, OysterDatabase reviewDatabase, BookingDatabase accommodationDatabase, TripAdvisorDatabase taDatabase) : base(rd, photoDatabase, reviewDatabase, accommodationDatabase, taDatabase)
 {
     //PhotoIterator.Next(); //set to first element
     //reviewIterator.Next(); //set to first element
     AccommodationIterator.Next(); //set to first element
     TaIterator.Next();            //set to first element
 }
 internal PolandTravel(TripAdvisorDatabase tripAdvisorDatabase,
                       OysterDatabase oysterDatabase,
                       BookingDatabase bookingDatabase,
                       ShutterStockDatabase stockDatabase)
     : base(tripAdvisorDatabase,
            oysterDatabase,
            bookingDatabase,
            stockDatabase)
 {
     this.Country = "Poland";
 }
 public FranceTravel(BookingDatabase accomodationData,
                     TripAdvisorDatabase tripsData,
                     ShutterStockDatabase photosData,
                     OysterDatabase reviewData,
                     Random _rd)
 {
     accomodationDataIterator = accomodationData.GetIterator();
     tripsDataIterator        = tripsData.GetIterator();
     photosDataIterator       = photosData.GetIterator();
     reviewDataIterator       = reviewData.GetIterator();
     rd = _rd;
 }
Exemple #5
0
        protected TravelAgency(Random rd, ShutterStockDatabase photoDatabase, OysterDatabase reviewDatabase, BookingDatabase accommodationDatabase, TripAdvisorDatabase taDatabase)
        {
            NumOfDaysRandomizer   = rd;
            PhotoIterator         = photoDatabase.GetIterator();
            ReviewIterator        = reviewDatabase.GetIterator();
            AccommodationIterator = accommodationDatabase.GetIterator();
            TaIterator            = taDatabase.GetIterator();

            PhotoDecoder         = photoDatabase.GetDecoder();
            AccommodationDecoder = accommodationDatabase.GetDecoder();
            TaDecoder            = taDatabase.GetDecoder();
        }
        public static ShutterStockDatabase GenerateShutterStockDataBase(Random R, int dbSize, int arrayMaxLength, double emptyChance)
        {
            var result = new ShutterStockDatabase();

            result.Photos = new PhotMetadata[R.Next(arrayMaxLength / 2, arrayMaxLength)][][];
            int toGenerateLeft = dbSize;

            for (int i = 0; i < result.Photos.Length; i++)
            {
                if (R.NextDouble() < emptyChance)
                {
                    continue;
                }
                result.Photos[i] = new PhotMetadata[R.Next(arrayMaxLength)][];
                for (int j = result.Photos[i].Length; j-- > 0;)
                {
                    if (R.NextDouble() < emptyChance)
                    {
                        continue;
                    }
                    result.Photos[i][j] = new PhotMetadata[Math.Min(R.Next(arrayMaxLength), toGenerateLeft)];
                    for (int k = result.Photos[i][j].Length; k-- > 0;)
                    {
                        if (R.NextDouble() < emptyChance)
                        {
                            continue;
                        }
                        result.Photos[i][j][k] = GeneratePhotoData(R);
                        if (--toGenerateLeft == 0)
                        {
                            return(result);
                        }
                    }
                }
            }
            return(result);
        }
        internal AbstractTravel(TripAdvisorDatabase tripAdvisorDatabase,
                                OysterDatabase oysterDatabase,
                                BookingDatabase bookingDatabase,
                                ShutterStockDatabase stockDatabase)
        {
            this.tripAdvisorDatabase = tripAdvisorDatabase;
            this.oysterDatabase      = oysterDatabase;
            this.bookingDatabase     = bookingDatabase;
            this.stockDatabase       = stockDatabase;

            it_booking = bookingDatabase.GetIterator();
            it_oyster  = oysterDatabase.GetIterator();
            it_stock   = stockDatabase.GetIterator();
            it_trip    = tripAdvisorDatabase.GetIterator();

            Min = 1;
            Max = 4;
            AttractiionsDaily = 3;
            bookingCoder      = BookingCoder.GetCoder();
            advisorCoder      = TripAdvisorCoder.GetCoder();
            stockCoder        = ShutterStockCoder.GetCoder();

            random = new Random();
        }
Exemple #8
0
 public FranceTravel(BookingDatabase bookingDatabase, OysterDatabase oysterDatabase, ShutterStockDatabase shutterDatabase, TripAdvisorDatabase advisorDatabase, Random random)
 {
     this.booking = new BookingIterator(bookingDatabase);
     this.oyster  = new OysterIterator(oysterDatabase);
     this.shutter = new ShutterStockIterator(shutterDatabase);
     this.advisor = new TripAdvisorIterator(advisorDatabase);
     this.random  = random;
 }