-
Notifications
You must be signed in to change notification settings - Fork 0
/
Party_Planner.py
882 lines (766 loc) · 41.3 KB
/
Party_Planner.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
import datetime
from Backing_Classes import *
from FuzzySets import Fuzzy
class PartyPlanner(KnowledgeEngine):
PARTY_NONE = 'NONE'
PARTY_BIRTHDAY = 'Birthday'
PARTY_ANNIVERSARY = 'Anniversary'
PARTY_GRADUATION = 'Graduation'
PARTY_GET_TOGETHER = 'Get Together'
AGES_NONE = 0
AGES_KIDS = 1
AGES_EARLY_TENS = 2
AGES_LATE_TENS = 3
AGES_EARLY_TWENTIES = 4
prices = {'Popcorn': {'Serves': 10, 'Price': 3.5}, 'Chips And Dip': {'Serves': 10, 'Price': 4},
'Garlic Bread': {'Serves': 2, 'Price': 2.5}, 'Finger Sandwiches': {'Serves': 3, 'Price': 5.75},
'Spring Rolls': {'Serves': 6, 'Price': 3.5}, 'Fondue': {'Serves': 50, 'Price': 50},
'Chocolate Fountain': {'Serves': 100, 'Price': 157}, 'Cupcakes': {'Serves': 12, 'Price': 16.5},
'Mini Pizzas': {'Serves': 3, 'Price': 6}, 'Mini Burgers': {'Serves': 1, 'Price': 2},
'Birthday Cake': {'Serves': 8, 'Price': 30},
'Water': {'Serves': 1, 'Price': 0}, 'Soda': {'Serves': 24, 'Price': 11},
'Juice Boxes': {'Serves': 10, 'Price': 2.5}, 'Beer': {'Serves': 10, 'Price': 11},
'Vodka': {'Serves': 7, 'Price': 23}, 'Whiskey': {'Serves': 7, 'Price': 34.5},
'Absinthe': {'Serves': 4, 'Price': 4},
'Hanging Decorations': {'Set': 6, 'Price': 10}, 'Bunting': {'Set': 1, 'Price': 10},
'Happy Birthday Banners': {'Set': 1, 'Price': 11}, 'Confetti': {'Set': 2, 'Price': 5},
'Pinata': {'Set': 1, 'Price': 12}, 'Center Pieces': {'Set': 1, 'Serves': 5, 'Price': 15},
'Balloons': {'Set': 1, 'Price': 0.9}, 'Candles and Votives': {'Set': 48, 'Price': 39},
'Party Poppers': {'Set': 20, 'Price': 3},
'Beverage Napkins': {'Serves': 25, 'Price': 2.5}, 'Plastic Forks': {'Serves': 25, 'Price': 5},
'Plastic Spoons': {'Serves': 25, 'Price': 5}, 'Plastic Knives': {'Serves': 25, 'Price': 5},
'Plastic Plates': {'Serves': 9, 'Price': 5}, 'Paper Cups': {'Serves': 12, 'Price': 4},
'Tablecloths': {'Serves': 1, 'Price': 2}}
def __init__(self):
super().__init__()
self.num_guests = 0
self.ages = PartyPlanner.AGES_NONE
self.alcoholic_drinks = False
self.date = datetime.date(2000, 1, 1)
self.party_type = PartyPlanner.PARTY_NONE
self.house_party = False
self.budget = 0
self.budget_class = ''
self.suggested_foods = []
self.suggested_menus = []
self.suggested_drinks = []
self.suggested_playlist = []
self.suggested_themes = []
self.suggested_decorations = []
self.suggested_tableware = []
self.final_foods_list_backtrack = []
self.final_drinks_list_backtrack = []
self.final_decorations_list_backtrack = []
self.final_foods_list_fuzzy = []
self.final_drinks_list_fuzzy = []
self.final_decorations_list_fuzzy = []
self.final_checklist = []
@DefFacts()
def init(self):
yield Food('House Party', List(['Popcorn', 'Chips And Dip', 'Garlic Bread', 'Finger Sandwiches', 'Spring Rolls',
'Fondue', 'Chocolate Fountain']))
yield Food('Kids Party', List(['Popcorn', 'Chips And Dip', 'Cupcakes', 'Finger Sandwiches', 'Mini Pizzas',
'Mini Burgers']))
yield Food('Birthday', List(['Birthday Cake']))
yield Drinks('House Party', List(['Water', 'Soda']))
yield Drinks('Kids Party', List(['Water', 'Soda', 'Juice Boxes']))
yield Drinks('Alcohol', List(['Beer', 'Absinthe', 'Vodka', 'Whiskey']))
# Fuzzy Facts
yield Food('House Party_Very Low', List(['Popcorn', 'Chips And Dip', 'Garlic Bread']))
yield Food('House Party_Low', List(['Popcorn', 'Chips And Dip', 'Garlic Bread', 'Finger Sandwiches']))
yield Food('House Party_Medium', List(['Popcorn', 'Chips And Dip', 'Garlic Bread', 'Finger Sandwiches',
'Spring Rolls']))
yield Food('House Party_High', List(['Popcorn', 'Chips And Dip', 'Garlic Bread', 'Finger Sandwiches',
'Spring Roll']))
yield Food('House Party_Very High', List(['Popcorn', 'Chips And Dip', 'Garlic Bread',
'Finger Sandwiches', 'Spring Rolls', 'Fondue', 'Chocolate Fountain']))
yield Drinks('House Party_Very Low', List(['Water', 'Soda']))
yield Drinks('House Party_Low', List(['Water', 'Soda']))
yield Drinks('House Party_Medium', List(['Water', 'Soda']))
yield Drinks('Alcohol_Medium', List(['Beer', 'Absinthe']))
yield Drinks('House Party_High', List(['Water', 'Soda']))
yield Drinks('Alcohol_High', List(['Beer', 'Absinthe', 'Vodka']))
yield Drinks('House Party_Very High', List(['Water', 'Soda']))
yield Drinks('Alcohol_Very High', List(['Beer', 'Absinthe', 'Vodka', 'Whiskey']))
# TODO implement Menu
yield Menu('Menu_1', List([]))
yield Menu('Menu_2', List([]))
yield Menu('Menu_3', List([]))
# yield MusicPlaylist('Kids Party', List(['The 1975-Chocolate', 'McFLY-Do Ya', 'PSY-Gangnam Style',
# 'One Direction-Best Song Ever', 'Years & Years-King',
# 'Coldplay-A Sky Full Of Stars', 'Sliento-Watch Me',
# 'Royal Blood-Figure It Out', 'LunchMoney Lewis-Bills',
# 'Buddy Holly & His Crickets-That\'ll Be The Day',
# 'Deep Purple-Smoke On The Water', 'Katy Perry-Roar',
# 'Toni Basil-Hey Mickey', 'The Muppets-Life\' a Happy Song',
# 'Taylor Swift-Blank Space', 'One Direction-What Makes You Beautiful',
# 'OMI-CHEERLEADER', 'Pharrel Williams-Happy', 'Taylor Swift-Wonderland']))
# yield MusicPlaylist('Birthday Kids', List(['Selena Gomez-Birthday', 'Weird Al Yankovic-Happy Birthday']))
# yield MusicPlaylist('Birthday Early Twenties', List(['Selena Gomez-Birthday', 'Sufjan Stevens-Happy Birthday',
# 'Mya-It\'s My Birthday',
# '50 Cent-In Da Club', '2Chainz-Birthday Song',
# 'Rihanna-Birthday Cake',
# 'Weird Al Yankovic-Happy Birthday', 'The Beatles-Birthday',
# 'David Joel and Eric Sage-Birthday Drinking Song',
# 'Madonna-B\'day Song']))
# yield MusicPlaylist('Graduation', List(['Halesy-Castle', 'Kygo & Selena Gomez-It Ain\'t Me',
# 'Ed Sheeran-Castle On The Hill',
# 'Wiz Khalifa & Charlie Puth-See You Again', 'Lady Gaga-Marry The Night',
# 'Rihanna-Never Ending', 'John Legend-Love Me Now', 'Ruth B-Lost Boy',
# 'Alessia Cara-Wild Things', 'MO-Final Sonng',
# 'Bruno Mars-Too Good To Say Goodbye', 'Beyonce-Run The World',
# 'Hayley Kiyoko-Given It All', 'Troye Sivan-YOUTH', ]))
yield MusicPlaylist('Anniversary', List(['https://open.spotify.com/user/1264690619/playlist/79NydVPZodhn3bG2LyKdrZ']))
yield MusicPlaylist('Kids Party',
List(['https://open.spotify.com/user/bbc_playlister/playlist/6uRN7aisZdhMyJ18irmLkT']))
yield MusicPlaylist('Graduation', List(['https://open.spotify.com/user/mmmmpai/playlist/7GEDv08p82OGmUP9g0ITYO']))
yield MusicPlaylist('Birthday', List(['https://open.spotify.com/user/meghantoumey/playlist/62KLyvQEueGcHYXf6HgAlu']))
yield MusicPlaylist('Birthday Kids', List(['https://open.spotify.com/album/3p9s4eTLHI1VMAgYWEKc3v']))
yield MusicPlaylist('House Party', List(['https://open.spotify.com/user/spotify/playlist/37i9dQZF1DXaXB8fQg7xif',
'https://open.spotify.com/user/spotify/playlist/37i9dQZF1DX0IlCGIUGBsA']))
yield MusicPlaylist('Party Late Tens',
List(['https://open.spotify.com/user/spotify/playlist/37i9dQZF1DX1N5uK98ms5p']))
yield Themes('Kids Party', List(['Princess/Prince Theme', 'Disney Theme', 'Easter Egg Hunt', 'Pirate']))
yield Themes('House Party', List(['Black and White', 'Formal Tea Party', 'Karaoke', 'Harry Potter',
'Lord Of The Rings', 'Mad Scientist', 'Under The Stars', 'Under The Sea',
'Fire and Ice']))
yield Decorations('Birthday', List(['Happy Birthday Banners', 'Balloons', 'Party Poppers', 'Gift Corner/Table']))
yield Decorations('Birthday_Under 15', List(['Happy Birthday Banners', 'Balloons', 'Party Poppers',
'Gift Corner/Table', 'Pinata', 'Bunting']))
yield Decorations('Anniversary', List(['Center Pieces', 'Confetti', 'Candles and Votives']))
yield Decorations('Generic', List(['Confetti', 'Balloons', 'Hanging Decorations']))
# Fuzzy Facts
yield Decorations('Birthday_Very Low', List(['Happy Birthday Banners', 'Balloons', 'Gift Corner/Table']))
yield Decorations('Birthday_Low', List(['Happy Birthday Banners', 'Balloons', 'Gift Corner/Table']))
yield Decorations('Birthday_Medium', List(['Happy Birthday Banners', 'Balloons', 'Party Poppers',
'Gift Corner/Table']))
yield Decorations('Birthday_High', List(['Happy Birthday Banners', 'Balloons', 'Party Poppers',
'Gift Corner/Table']))
yield Decorations('Birthday_Very High', List(['Happy Birthday Banners', 'Balloons', 'Party Poppers',
'Gift Corner/Table']))
yield Decorations('Birthday_Under 15_Very Low', List(['Happy Birthday Banners', 'Balloons', 'Party Poppers',
'Gift Corner/Table']))
yield Decorations('Birthday_Under 15_Low', List(['Happy Birthday Banners', 'Balloons', 'Party Poppers',
'Gift Corner/Table']))
yield Decorations('Birthday_Under 15_Medium', List(['Happy Birthday Banners', 'Balloons', 'Party Poppers',
'Gift Corner/Table', 'Pinata']))
yield Decorations('Birthday_Under 15_High', List(['Happy Birthday Banners', 'Balloons', 'Party Poppers',
'Gift Corner/Table', 'Pinata', 'Bunting']))
yield Decorations('Birthday_Under 15_Very High', List(['Happy Birthday Banners', 'Balloons', 'Party Poppers',
'Gift Corner/Table', 'Pinata', 'Bunting']))
yield Decorations('Anniversary_Very Low', List(['Confetti']))
yield Decorations('Anniversary_Low', List(['Confetti']))
yield Decorations('Anniversary_Medium', List(['Center Pieces', 'Confetti']))
yield Decorations('Anniversary_High', List(['Center Pieces', 'Confetti', 'Candles and Votives']))
yield Decorations('Anniversary_Very High', List(['Center Pieces', 'Confetti', 'Candles and Votives']))
yield Decorations('Generic_Very Low', List(['Balloons']))
yield Decorations('Generic_Low', List(['Balloons']))
yield Decorations('Generic_Medium', List(['Balloons', 'Confetti']))
yield Decorations('Generic_High', List(['Balloons', 'Confetti', 'Hanging Decorations']))
yield Decorations('Generic_Very High', List(['Balloons', 'Confetti', 'Hanging Decorations']))
yield Tableware(List(['Beverage Napkins', 'Plastic Forks', 'Plastic Spoons', 'Plastic Knives', 'Plastic Plates',
'Paper Cups', 'Tablecloths']))
yield Checklist(List(['Make An Invitation List',
'Decide On A Theme',
'Send Invitations',
'Choose Playlist',
'Do A Round Of Shopping',
'Clean The House',
'Take Inventory',
'Stock The Bar',
'Decorate',
'Another Round Of Shopping',
'Set The Tables',
'Finish As Much Cooking As You Can',
'Display Food',
'Have A Great Time']))
def set_facts(self, num_guests, ages, alcoholic_drinks, date, party_type, house_party, budget):
self.num_guests = num_guests
self.ages = ages
self.alcoholic_drinks = alcoholic_drinks
self.date = date
self.party_type = party_type
self.house_party = house_party
self.budget = budget
self.budget_class = Fuzzy.fuzzify_over_n(budget, num_guests)
self.declare(GuestsNumber(num_guests))
self.declare(Ages(ages))
self.declare(Alcoholic(alcoholic_drinks))
self.declare(Date(date))
self.declare(PartyType(party_type))
self.declare(HouseParty(house_party))
self.declare(Budget(budget))
self.declare(BudgetClass(self.budget_class))
@Rule(HouseParty(True), PartyType(PARTY_GET_TOGETHER), Ages(AGES_LATE_TENS),
Food('House Party', 'foods' << W()))
def suggest_foods_late_tens_get_together(self, foods):
for item in foods.get_list():
self.suggested_foods.append(item)
self.declare(Done('Food'))
@Rule(HouseParty(True), PartyType(PARTY_GET_TOGETHER), Ages(AGES_EARLY_TWENTIES),
Food('House Party', 'foods' << W()))
def suggest_foods_early_twenties_get_together(self, foods):
for item in foods.get_list():
self.suggested_foods.append(item)
self.declare(Done('Food'))
@Rule(HouseParty(True), PartyType(PARTY_BIRTHDAY), Ages(AGES_KIDS),
Food('Kids Party', 'foods' << W()), Food('Birthday', 'birthday_foods' << W()))
def suggest_foods_kids_birthday(self, foods, birthday_foods):
for item in foods.get_list():
self.suggested_foods.append(item)
for item in birthday_foods.get_list():
self.suggested_foods.append(item)
self.declare(Done('Food'))
@Rule(HouseParty(True), PartyType(PARTY_BIRTHDAY), Ages(AGES_EARLY_TENS),
Food('Kids Party', 'foods' << W()), Food('Birthday', 'birthday_foods' << W()))
def suggest_foods_early_tens_birthday(self, foods, birthday_foods):
for item in foods.get_list():
self.suggested_foods.append(item)
for item in birthday_foods.get_list():
self.suggested_foods.append(item)
self.declare(Done('Food'))
@Rule(HouseParty(True), PartyType(PARTY_BIRTHDAY), Ages(AGES_LATE_TENS),
Food('House Party', 'foods' << W()), Food('Birthday', 'birthday_foods' << W()))
def suggest_foods_late_tens_birthday(self, foods, birthday_foods):
for item in foods.get_list():
self.suggested_foods.append(item)
for item in birthday_foods.get_list():
self.suggested_foods.append(item)
self.declare(Done('Food'))
@Rule(HouseParty(True), PartyType(PARTY_BIRTHDAY), Ages(AGES_EARLY_TWENTIES),
Food('House Party', 'foods' << W()), Food('Birthday', 'birthday_foods' << W()))
def suggest_foods_early_twenties_birthday(self, foods, birthday_foods):
for item in foods.get_list():
self.suggested_foods.append(item)
for item in birthday_foods.get_list():
self.suggested_foods.append(item)
self.declare(Done('Food'))
@Rule(HouseParty(False),
Menu('Menu_1', 'menu1' << W()), Menu('Menu_2', 'menu2' << W()), Menu('Menu_3', 'menu3' << W()))
def suggest_menus(self, menu1, menu2, menu3):
print('''This Program Can Not Predict Exactly What A Restaurant Might Offer In Terms Of Menus Of Food In General
But You Can Expect Prices Around 50$ Per Guest''')
# TODO review drinks suggestion different in house and out
@Rule(HouseParty(True), Ages(AGES_KIDS),
Drinks('Kids Party', 'drinks' << W()))
def suggest_drinks_kids(self, drinks):
for item in drinks.get_list():
self.suggested_drinks.append(item)
self.declare(Done('Drinks'))
@Rule(HouseParty(True), Ages(AGES_EARLY_TENS),
Drinks('Kids Party', 'drinks' << W()))
def suggest_drinks_early_tens(self, drinks):
for item in drinks.get_list():
self.suggested_drinks.append(item)
self.declare(Done('Drinks'))
@Rule(HouseParty(True), Ages(AGES_LATE_TENS),
Drinks('House Party', 'drinks' << W()))
def suggest_drinks_late_tens(self, drinks):
for item in drinks.get_list():
self.suggested_drinks.append(item)
self.declare(Done('Drinks'))
@Rule(HouseParty(True), Ages(AGES_EARLY_TWENTIES), Alcoholic(False),
Drinks('House Party', 'drinks' << W()))
def suggest_drinks_early_twenties(self, drinks):
for item in drinks.get_list():
self.suggested_drinks.append(item)
self.declare(Done('Drinks'))
@Rule(HouseParty(True), Ages(AGES_EARLY_TWENTIES), Alcoholic(True),
Drinks('House Party', 'drinks' << W()), Drinks('Alcohol', 'alcohol' << W()))
def suggest_drinks_early_twenties_alcohol(self, drinks, alcohol):
for item in drinks.get_list():
self.suggested_drinks.append(item)
for item in alcohol.get_list():
self.suggested_drinks.append(item)
self.declare(Done('Drinks'))
@Rule(PartyType(PARTY_BIRTHDAY), Ages(AGES_KIDS),
MusicPlaylist('Birthday Kids', 'playlist' << W()))
def suggest_music_birthday_kids(self, playlist):
for item in playlist.get_list():
self.suggested_playlist.append(item)
self.declare(Done('Music'))
@Rule(PartyType(PARTY_BIRTHDAY), Ages(AGES_EARLY_TENS),
MusicPlaylist('Birthday Kids', 'playlist' << W()))
def suggest_music_birthday_early_tens(self, playlist):
for item in playlist.get_list():
self.suggested_playlist.append(item)
self.declare(Done('Music'))
@Rule(PartyType(PARTY_BIRTHDAY), Ages(AGES_LATE_TENS),
MusicPlaylist('Birthday', 'playlist' << W()))
def suggest_music_birthday_late_tens(self, playlist):
for item in playlist.get_list():
self.suggested_playlist.append(item)
self.declare(Done('Music'))
@Rule(PartyType(PARTY_BIRTHDAY), Ages(AGES_EARLY_TWENTIES),
MusicPlaylist('Birthday', 'playlist' << W()))
def suggest_music_birthday_early_twenties(self, playlist):
for item in playlist.get_list():
self.suggested_playlist.append(item)
self.declare(Done('Music'))
@Rule(PartyType(PARTY_GET_TOGETHER), Ages(AGES_LATE_TENS),
MusicPlaylist('Party Late Tens', 'playlist' << W()))
def suggest_music_house_party_late_tens(self, playlist):
for item in playlist.get_list():
self.suggested_playlist.append(item)
self.declare(Done('Music'))
@Rule(PartyType(PARTY_GET_TOGETHER), Ages(AGES_EARLY_TWENTIES),
MusicPlaylist('House Party', 'playlist' << W()))
def suggest_music_house_party_early_twenties(self, playlist):
for item in playlist.get_list():
self.suggested_playlist.append(item)
self.declare(Done('Music'))
@Rule(PartyType(PARTY_ANNIVERSARY),
MusicPlaylist('Anniversary', 'playlist' << W()))
def suggest_music_anniversary_party(self, playlist):
for item in playlist.get_list():
self.suggested_playlist.append(item)
self.declare(Done('Music'))
@Rule(PartyType(PARTY_GRADUATION),
MusicPlaylist('Graduation', 'playlist' << W()))
def suggest_music_graduation_party(self, playlist):
for item in playlist.get_list():
self.suggested_playlist.append(item)
self.declare(Done('Music'))
@Rule(HouseParty(True), PartyType(PARTY_GET_TOGETHER), Ages(AGES_LATE_TENS),
Themes('House Party', 'themes' << W()))
def suggest_themes_house_party_late_tens(self, themes):
for item in themes.get_list():
self.suggested_themes.append(item)
self.declare(Done('Themes'))
@Rule(HouseParty(True), PartyType(PARTY_GET_TOGETHER), Ages(AGES_EARLY_TWENTIES),
Themes('House Party', 'themes' << W()))
def suggest_themes_house_party_early_twenties(self, themes):
for item in themes.get_list():
self.suggested_themes.append(item)
self.declare(Done('Themes'))
@Rule(HouseParty(True), PartyType(PARTY_BIRTHDAY), Ages(AGES_KIDS),
Themes('Kids Party', 'themes' << W()))
def suggest_themes_birthday_kids(self, themes):
for item in themes.get_list():
self.suggested_themes.append(item)
self.declare(Done('Themes'))
@Rule(HouseParty(True), PartyType(PARTY_BIRTHDAY), Ages(AGES_EARLY_TENS),
Themes('Kids Party', 'themes' << W()))
def suggest_themes_birthday_early_tens(self, themes):
for item in themes.get_list():
self.suggested_themes.append(item)
self.declare(Done('Themes'))
@Rule(HouseParty(True), PartyType(PARTY_GET_TOGETHER), Ages(AGES_LATE_TENS),
Decorations('Generic', 'decorations' << W()))
def suggest_decorations_house_party_late_tens(self, decorations):
for item in decorations.get_list():
self.suggested_decorations.append(item)
self.suggested_decorations.append('Theme Specific Decorations')
self.declare(Done('Decorations'))
@Rule(HouseParty(True), PartyType(PARTY_GET_TOGETHER), Ages(AGES_EARLY_TWENTIES),
Decorations('Generic', 'decorations' << W()))
def suggest_decorations_house_party_early_twenties(self, decorations):
for item in decorations.get_list():
self.suggested_decorations.append(item)
self.suggested_decorations.append('Theme Specific Decorations')
self.declare(Done('Decorations'))
@Rule(HouseParty(True), PartyType(PARTY_GRADUATION),
Decorations('Graduation', 'decorations' << W()))
def suggest_decorations_graduation_party(self, decorations):
for item in decorations.get_list():
self.suggested_decorations.append(item)
self.declare(Done('Decorations'))
@Rule(HouseParty(True), PartyType(PARTY_ANNIVERSARY),
Decorations('Anniversary', 'decorations' << W()))
def suggest_decorations_anniversary_party(self, decorations):
for item in decorations.get_list():
self.suggested_decorations.append(item)
self.declare(Done('Decorations'))
@Rule(HouseParty(True), PartyType(PARTY_BIRTHDAY), Ages(AGES_KIDS),
Decorations('Birthday_Under 15', 'decorations' << W()))
def suggest_decorations_birthday_kids(self, decorations):
for item in decorations.get_list():
self.suggested_decorations.append(item)
self.suggested_decorations.append('Theme Specific Decorations')
self.declare(Done('Decorations'))
@Rule(HouseParty(True), PartyType(PARTY_BIRTHDAY), Ages(AGES_EARLY_TENS),
Decorations('Birthday_Under 15', 'decorations' << W()))
def suggest_decorations_birthday_early_tens(self, decorations):
for item in decorations.get_list():
self.suggested_decorations.append(item)
self.suggested_decorations.append('Theme Specific Decorations')
self.declare(Done('Decorations'))
@Rule(HouseParty(True), PartyType(PARTY_BIRTHDAY), Ages(AGES_LATE_TENS),
Decorations('Birthday', 'decorations' << W()))
def suggest_decorations_birthday_late_tens(self, decorations):
for item in decorations.get_list():
self.suggested_decorations.append(item)
self.suggested_decorations.append('Theme Specific Decorations')
self.declare(Done('Decorations'))
@Rule(HouseParty(True), PartyType(PARTY_BIRTHDAY), Ages(AGES_EARLY_TWENTIES),
Decorations('Birthday', 'decorations' << W()))
def suggest_decorations_birthday_early_twenties(self, decorations):
for item in decorations.get_list():
self.suggested_decorations.append(item)
self.suggested_decorations.append('Theme Specific Decorations')
self.declare(Done('Decorations'))
@Rule(HouseParty(True),
Tableware('tableware' << W()))
def suggest_tableware(self, tableware):
for item in tableware.get_list():
self.suggested_tableware.append(item)
self.declare(Done('Tableware'))
@Rule(HouseParty(True), Done('Food'), Done('Drinks'), Done('Decorations'), Done('Tableware'), Done('Music'),
Done('Themes'), Budget('budget' << W()))
def create_list_of_suggestions_backtrack(self, budget):
initial_cost = 0
# Calculate cost of tableware
for item in self.suggested_tableware:
initial_cost += PartyPlanner.prices[item]['Price'] * self.num_guests/PartyPlanner.prices[item]['Serves']
food_combinations = []
food_combinations_prices = []
drinks_combinations = []
drinks_combinations_prices = []
decorations_combinations = []
decorations_combinations_prices = []
tmp = []
self.backtrack_food(0, 0, tmp, food_combinations, food_combinations_prices)
tmp = []
self.backtrack_drinks(0, 0, tmp, drinks_combinations, drinks_combinations_prices)
tmp = []
self.backtrack_decorations(0, 0, tmp, decorations_combinations, decorations_combinations_prices)
take_foods = -1
take_drinks = -1
take_decorations = -1
min_diff = 1000000
for i in range(len(food_combinations)):
for j in range(len(drinks_combinations)):
for k in range(len(decorations_combinations)):
diff = abs(budget -
(initial_cost + food_combinations_prices[i] +
drinks_combinations_prices[j] + decorations_combinations_prices[k]))
if diff < min_diff:
min_diff = diff
take_foods = i
take_drinks = j
take_decorations = k
self.final_foods_list_backtrack = food_combinations[take_foods]
self.final_drinks_list_backtrack = drinks_combinations[take_drinks]
self.final_decorations_list_backtrack = decorations_combinations[take_decorations]
def backtrack_food(self, i, price, tmp, food_combinations, food_combinations_prices):
if i == len(self.suggested_foods):
food_combinations.append(tmp.copy())
food_combinations_prices.append(price)
return
food = self.suggested_foods[i]
if food == 'Fondue':
get = int(self.num_guests / PartyPlanner.prices[food]['Serves'])
if self.num_guests % PartyPlanner.prices[food]['Serves'] > 25:
get += 1
price_add = get*PartyPlanner.prices[food]['Price']
food = food + ' x' + str(get) + ' each serving ' + str(PartyPlanner.prices[food]['Serves'])
if get > 0:
tmp.append(food)
self.backtrack_food(i + 1, price + price_add, tmp, food_combinations, food_combinations_prices)
tmp.pop()
elif food == 'Chocolate Fountain':
get = int(self.num_guests / PartyPlanner.prices[food]['Serves'])
if self.num_guests % PartyPlanner.prices[food]['Serves'] > 25:
get += 1
price_add = get * PartyPlanner.prices[food]['Price']
food = food + ' x' + str(get) + ' each serving ' + str(PartyPlanner.prices[food]['Serves'])
if get > 0:
tmp.append(food)
self.backtrack_food(i + 1, price + price_add, tmp, food_combinations, food_combinations_prices)
tmp.pop()
else:
price_add = (PartyPlanner.prices[food]['Price'] * self.num_guests/PartyPlanner.prices[food]['Serves'])
food = food + ' x' + str(int(self.num_guests/PartyPlanner.prices[food]['Serves'])) + \
' each serving ' + str(PartyPlanner.prices[food]['Serves'])
tmp.append(food)
self.backtrack_food(i + 1, price + price_add, tmp, food_combinations, food_combinations_prices)
tmp.pop()
self.backtrack_food(i + 1, price, tmp, food_combinations, food_combinations_prices)
def backtrack_drinks(self, i, price, tmp, drinks_combinations, drinks_combinations_prices):
if i == len(self.suggested_drinks):
drinks_combinations.append(tmp.copy())
drinks_combinations_prices.append(price)
return
drink = self.suggested_drinks[i]
get = int(self.num_guests/PartyPlanner.prices[drink]['Serves'])
if self.num_guests % PartyPlanner.prices[drink]['Serves'] > 0:
get += 1
price_add = (PartyPlanner.prices[drink]['Price'] * get)
drink = drink + ' x' + str(get) + ' each serving ' + str(PartyPlanner.prices[drink]['Serves'])
tmp.append(drink)
self.backtrack_drinks(i+1, price + price_add, tmp, drinks_combinations, drinks_combinations_prices)
tmp.pop()
self.backtrack_drinks(i + 1, price, tmp, drinks_combinations, drinks_combinations_prices)
def backtrack_decorations(self, i, price, tmp, decorations_combinations, decorations_combinations_prices):
if i == len(self.suggested_decorations):
decorations_combinations.append(tmp.copy())
decorations_combinations_prices.append(price)
return
decoration = self.suggested_decorations[i]
tmp.append(decoration)
price_add = 0
if decoration == 'Hanging Decorations':
price_add = 2 * PartyPlanner.prices[decoration]['Price'] / PartyPlanner.prices[decoration]['Set']
elif decoration == 'Bunting':
price_add = 6 * PartyPlanner.prices[decoration]['Price'] / PartyPlanner.prices[decoration]['Set']
elif decoration == 'Happy Birthday Banners':
price_add = 3 * PartyPlanner.prices[decoration]['Price'] / PartyPlanner.prices[decoration]['Set']
elif decoration == 'Confetti':
price_add = 3 * PartyPlanner.prices[decoration]['Price'] / PartyPlanner.prices[decoration]['Set']
elif decoration == 'Pinata':
price_add = PartyPlanner.prices[decoration]['Price'] / PartyPlanner.prices[decoration]['Set']
elif decoration == 'Center Pieces':
price_add = self.num_guests/5 * PartyPlanner.prices[decoration]['Price'] / PartyPlanner.prices[decoration]['Set']
elif decoration == 'Balloons':
price_add = 24 * PartyPlanner.prices[decoration]['Price'] / PartyPlanner.prices[decoration]['Set']
elif decoration == 'Candles and Votives':
price_add = 2 * self.num_guests/5 * PartyPlanner.prices[decoration]['Price'] / PartyPlanner.prices[decoration]['Set']
elif decoration == 'Party Poppers':
price_add = 2 * PartyPlanner.prices[decoration]['Price'] / PartyPlanner.prices[decoration]['Set']
self.backtrack_decorations(i+1, price + price_add, tmp, decorations_combinations, decorations_combinations_prices)
tmp.pop()
self.backtrack_decorations(i + 1, price, tmp, decorations_combinations, decorations_combinations_prices)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very Low'), Food('House Party_Very Low', 'foods' << W()), NOT(PartyType(PARTY_BIRTHDAY)),
Drinks('House Party_Very Low', 'drinks' << W()))
def create_list_of_suggestions_fuzzy_very_low(self, foods, drinks):
for item in foods.get_list():
self.final_foods_list_fuzzy.append(item)
for item in drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very Low'), Food('House Party_Very Low', 'foods' << W()), PartyType(PARTY_BIRTHDAY),
Food('Birthday', 'birthday' << W()),
Drinks('House Party_Very Low', 'drinks' << W()))
def create_list_of_suggestions_fuzzy_very_low_birthday(self, foods, drinks, birthday):
for item in foods.get_list():
self.final_foods_list_fuzzy.append(item)
for item in birthday.get_list():
self.final_foods_list_fuzzy.append(item)
for item in drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Low'), Food('House Party_Low', 'foods' << W()), NOT(PartyType(PARTY_BIRTHDAY)),
Drinks('House Party_Low', 'drinks' << W()), Alcoholic(False))
def create_list_of_suggestions_fuzzy_low(self, foods, drinks):
for item in foods.get_list():
self.final_foods_list_fuzzy.append(item)
for item in drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Low'), Food('House Party_Low', 'foods' << W()), PartyType(PARTY_BIRTHDAY),
Food('Birthday', 'birthday' << W()),
Drinks('House Party_Low', 'drinks' << W()), Alcoholic(False))
def create_list_of_suggestions_fuzzy_low_birthday(self, foods, drinks, birthday):
for item in foods.get_list():
self.final_foods_list_fuzzy.append(item)
for item in birthday.get_list():
self.final_foods_list_fuzzy.append(item)
for item in drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Medium'), Food('House Party_Medium', 'foods' << W()), NOT(PartyType(PARTY_BIRTHDAY)),
Drinks('House Party_Medium', 'drinks' << W()), Alcoholic('alcohol' << W()),
Drinks('Alcohol_Medium', 'alcoholic_drinks' << W()))
def create_list_of_suggestions_fuzzy_medium(self, foods, drinks, alcohol, alcoholic_drinks):
for item in foods.get_list():
self.final_foods_list_fuzzy.append(item)
for item in drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
if alcohol:
for item in alcoholic_drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Medium'), Food('House Party_Medium', 'foods' << W()), PartyType(PARTY_BIRTHDAY),
Food('Birthday', 'birthday' << W()),
Drinks('House Party_Medium', 'drinks' << W()), Alcoholic('alcohol' << W()),
Drinks('Alcohol_Medium', 'alcoholic_drinks' << W()))
def create_list_of_suggestions_fuzzy_medium_birthday(self, foods, drinks, birthday, alcohol, alcoholic_drinks):
for item in foods.get_list():
self.final_foods_list_fuzzy.append(item)
for item in birthday.get_list():
self.final_foods_list_fuzzy.append(item)
for item in drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
if alcohol:
for item in alcoholic_drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('High'), Food('House Party_High', 'foods' << W()), NOT(PartyType(PARTY_BIRTHDAY)),
Drinks('House Party_High', 'drinks' << W()), Alcoholic('alcohol' << W()),
Drinks('Alcohol_High', 'alcoholic_drinks' << W()))
def create_list_of_suggestions_fuzzy_high(self, foods, drinks, alcohol, alcoholic_drinks):
for item in foods.get_list():
self.final_foods_list_fuzzy.append(item)
for item in drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
if alcohol:
for item in alcoholic_drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('High'), Food('House Party_High', 'foods' << W()), PartyType(PARTY_BIRTHDAY),
Food('Birthday', 'birthday' << W()),
Drinks('House Party_High', 'drinks' << W()), Alcoholic('alcohol' << W()),
Drinks('Alcohol_High', 'alcoholic_drinks' << W()))
def create_list_of_suggestions_fuzzy_high_birthday(self, foods, drinks, birthday, alcohol, alcoholic_drinks):
for item in foods.get_list():
self.final_foods_list_fuzzy.append(item)
for item in birthday.get_list():
self.final_foods_list_fuzzy.append(item)
for item in drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
if alcohol:
for item in alcoholic_drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very High'), Food('House Party_Very High', 'foods' << W()), NOT(PartyType(PARTY_BIRTHDAY)),
Drinks('House Party_Very High', 'drinks' << W()), Alcoholic('alcohol' << W()),
Drinks('Alcohol_Very High', 'alcoholic_drinks' << W()))
def create_list_of_suggestions_fuzzy_very_high(self, foods, drinks, alcohol, alcoholic_drinks):
for item in foods.get_list():
self.final_foods_list_fuzzy.append(item)
for item in drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
if alcohol:
for item in alcoholic_drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very High'), Food('House Party_Very High', 'foods' << W()), PartyType(PARTY_BIRTHDAY),
Food('Birthday', 'birthday' << W()),
Drinks('House Party_Very High', 'drinks' << W()), Alcoholic('alcohol' << W()),
Drinks('Alcohol_Very High', 'alcoholic_drinks' << W()))
def create_list_of_suggestions_fuzzy_very_high_birthday(self, foods, drinks, birthday, alcohol, alcoholic_drinks):
for item in foods.get_list():
self.final_foods_list_fuzzy.append(item)
for item in birthday.get_list():
self.final_foods_list_fuzzy.append(item)
for item in drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
if alcohol:
for item in alcoholic_drinks.get_list():
self.final_drinks_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very Low'), PartyType(PARTY_BIRTHDAY), OR(Ages(AGES_KIDS), Ages(AGES_EARLY_TENS)),
Decorations('Birthday_Under 15_Very Low', 'decorations' << W()))
def create_list_of_decorations_fuzzy_very_low_birthday_under_15(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Low'), PartyType(PARTY_BIRTHDAY), OR(Ages(AGES_KIDS), Ages(AGES_EARLY_TENS)),
Decorations('Birthday_Under 15_Low', 'decorations' << W()))
def create_list_of_decorations_fuzzy_low_birthday_under_15(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Medium'), PartyType(PARTY_BIRTHDAY), OR(Ages(AGES_KIDS), Ages(AGES_EARLY_TENS)),
Decorations('Birthday_Under 15_Medium', 'decorations' << W()))
def create_list_of_decorations_fuzzy_medium_birthday_under_15(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('High'), PartyType(PARTY_BIRTHDAY), OR(Ages(AGES_KIDS), Ages(AGES_EARLY_TENS)),
Decorations('Birthday_Under 15_High', 'decorations' << W()))
def create_list_of_decorations_fuzzy_high_birthday_under_15(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very High'), PartyType(PARTY_BIRTHDAY), OR(Ages(AGES_KIDS), Ages(AGES_EARLY_TENS)),
Decorations('Birthday_Under 15_Very High', 'decorations' << W()))
def create_list_of_decorations_fuzzy_very_high_birthday_under_15(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very Low'), PartyType(PARTY_BIRTHDAY), OR(Ages(AGES_LATE_TENS), Ages(AGES_EARLY_TWENTIES)),
Decorations('Birthday_Very Low', 'decorations' << W()))
def create_list_of_decorations_fuzzy_very_low_birthday(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Low'), PartyType(PARTY_BIRTHDAY), OR(Ages(AGES_LATE_TENS), Ages(AGES_EARLY_TWENTIES)),
Decorations('Birthday_Low', 'decorations' << W()))
def create_list_of_decorations_fuzzy_low_birthday(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Medium'), PartyType(PARTY_BIRTHDAY), OR(Ages(AGES_LATE_TENS), Ages(AGES_EARLY_TWENTIES)),
Decorations('Birthday_Medium', 'decorations' << W()))
def create_list_of_decorations_fuzzy_medium_birthday(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('High'), PartyType(PARTY_BIRTHDAY), OR(Ages(AGES_LATE_TENS), Ages(AGES_EARLY_TWENTIES)),
Decorations('Birthday_High', 'decorations' << W()))
def create_list_of_decorations_fuzzy_high_birthday(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very High'), PartyType(PARTY_BIRTHDAY), OR(Ages(AGES_LATE_TENS), Ages(AGES_EARLY_TWENTIES)),
Decorations('Birthday_Very High', 'decorations' << W()))
def create_list_of_decorations_fuzzy_very_high_birthday(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very Low'), PartyType(PARTY_ANNIVERSARY),
Decorations('Anniversary_Very Low', 'decorations' << W()))
def create_list_of_decorations_fuzzy_very_low_anniversary(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Low'), PartyType(PARTY_ANNIVERSARY),
Decorations('Anniversary_Low', 'decorations' << W()))
def create_list_of_decorations_fuzzy_low_anniversary(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Medium'), PartyType(PARTY_ANNIVERSARY),
Decorations('Anniversary_Medium', 'decorations' << W()))
def create_list_of_decorations_fuzzy_medium_anniversary(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('High'), PartyType(PARTY_ANNIVERSARY),
Decorations('Anniversary_High', 'decorations' << W()))
def create_list_of_decorations_fuzzy_high_anniversary(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very High'), PartyType(PARTY_ANNIVERSARY),
Decorations('Anniversary_Very High', 'decorations' << W()))
def create_list_of_decorations_fuzzy_very_high_anniversary(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very Low'), OR(PartyType(PARTY_GET_TOGETHER), PartyType(PARTY_GRADUATION)),
Decorations('Generic_Very Low', 'decorations' << W()))
def create_list_of_decorations_fuzzy_very_low_generic(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Low'), OR(PartyType(PARTY_GET_TOGETHER), PartyType(PARTY_GRADUATION)),
Decorations('Generic_Low', 'decorations' << W()))
def create_list_of_decorations_fuzzy_low_generic(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Medium'), OR(PartyType(PARTY_GET_TOGETHER), PartyType(PARTY_GRADUATION)),
Decorations('Generic_Medium', 'decorations' << W()))
def create_list_of_decorations_fuzzy_medium_generic(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('High'), OR(PartyType(PARTY_GET_TOGETHER), PartyType(PARTY_GRADUATION)),
Decorations('Generic_High', 'decorations' << W()))
def create_list_of_decorations_fuzzy_high_generic(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True), Done('Tableware'), Done('Music'), Done('Themes'),
BudgetClass('Very High'), OR(PartyType(PARTY_GET_TOGETHER), PartyType(PARTY_GRADUATION)),
Decorations('Generic_Very High', 'decorations' << W()))
def create_list_of_decorations_fuzzy_very_high_generic(self, decorations):
for item in decorations.get_list():
self.final_decorations_list_fuzzy.append(item)
@Rule(HouseParty(True),
Checklist('checklist' << W()))
def create_checklist(self, checklist):
for item in checklist.get_list():
self.final_checklist.append(item)