-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAccommodation.pl
192 lines (153 loc) · 4.75 KB
/
Accommodation.pl
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
%Turning off warnings
:-style_check(-discontiguous).
:- use_module(library(persistency)).
:- persistent image(fact1:(any), any, any).
:- persistent bed_and_breakfast(fact1:(any), any, any).
:- persistent one_s(fact1:(any), any, any).
:- persistent two_s(fact1:(any), any, any).
:- persistent three_s(fact1:(any), any, any).
:- persistent bunjee_jumping(fact1:(any), any, any).
:- persistent adv_safari(fact1:(any), any, any).
:- persistent sunbathing(fact1:(any), any, any).
:- persistent yoga(fact1:(any), any, any).
:- persistent museums(fact1:(any), any, any).
:- persistent s_safari(fact1:(any), any, any).
:- persistent hiking(fact1:(any), any, any).
:- persistent surfing(fact1:(any), any, any).
:- persistent contact(fact1:(any), any, any).
:- persistent beach(fact1:(any), any, any).
:- persistent farm_land(fact1:(any), any, any).
:- persistent national_park(fact1:(any), any, any).
:- persistent town(fact1:(any), any, any).
:- initialization(init).
init:-
absolute_file_name('fact.db', File, [access(write)]),
db_attach(File, []).
:-include('Cities/Copenhagen.pl').
:-include('Cities/Dubai.pl').
:-include('Cities/Johannesburg.pl').
:-include('Cities/Kyoto.pl').
:-include('Cities/Londres.pl').
:-include('Cities/NovaYork.pl').
:-include('Cities/Orlando.pl').
:-include('Cities/Paris.pl').
:-include('Cities/Rio_de_Janeiro.pl').
:-include('Cities/Sydney.pl').
:-include('Cities/Tokyo.pl').
:-include('Cities/Wellington.pl').
:-include('Cities/Seul.pl').
:-include('Cities/Roma.pl').
:-include('Cities/Moscou.pl').
:-include('Cities/Zurique.pl').
:-include('Cities/Jerusalem.pl').
:-include('Cities/Gramado.pl').
:-dynamic image/3.
:-dynamic bed_and_breakfast/3.
:-dynamic one_s/3.
:-dynamic two_s/3.
:-dynamic three_s/3.
:-dynamic bunjee_jumping/3.
:-dynamic adv_safari/3.
:-dynamic sunbathing/3.
:-dynamic yoga/3.
:-dynamic museums/3.
:-dynamic s_safari/3.
:-dynamic hiking/3.
:-dynamic surfing/3.
:-dynamic contact/3.
:-dynamic beach/3.
:-dynamic farm_land/3.
:-dynamic national_park/3.
:-dynamic town/3.
%Accommodation
accommodation(AC, CITY, Phone, Image) :-
budget_accommodation(AC, CITY, Phone, Image);
campground(AC, CITY, Phone, Image);
hotel(AC, CITY, Phone, Image).
%BudgetCommodation
budget_accommodation(AC, CITY, Phone, Image):-
(one_s(AC, CITY, true);
two_s(AC, CITY, true)),
contact(AC, CITY, Phone),
image(AC, CITY, Image).
%CampGround
campground(AC, CITY, Phone, Image):-
one_s(AC, CITY, true),
contact(AC, CITY, Phone),
image(AC, CITY, Image).
%Hotel
hotel(AC, CITY, Phone, Image):-
bed_and_breakfast(AC, CITY,false),
%if one_s = false then is not a campgroud
one_s(AC, CITY, false),
contact(AC, CITY, Phone),
image(AC, CITY, Image).
%LuxuryHotel
luxury_hotel(AC, CITY):-
three_s(AC, CITY, true).
%AccommodationRating
accommodation_rating(AC, CITY) :-
one_s(AC, CITY, true);
two_s(AC, CITY, true);
three_s(AC, CITY, true).
%Activity
%Adventure
adventure(AC, CITY, true):-
bunjee_jumping(AC, CITY, true);
adv_safari(AC, CITY, true).
%Relaxation
relaxation(AC, CITY):-
sunbathing(AC, CITY, true);
yoga(AC, CITY, true).
%Sightseeing
sightseeing(AC, CITY):-
museums(AC, CITY, true);
s_safari(AC, CITY, true).
%Sports
sports(AC, CITY):-
hiking(AC, CITY, true);
surfing(AC, CITY, true).
activity(AC, CITY, true):-
adventure(AC, CITY, true);
relaxation(AC, CITY);
sightseeing(AC, CITY);
sports(AC, CITY).
%Destination
%BackPackersDestination
back_packers_destination(AC, CITY, Phone, Image):-
(budget_accommodation(AC, CITY, Phone, Image),
(adventure(AC, CITY, true); sports(AC, CITY))).
%BudgetHotelDestination
budget_hotel_destination(AC, CITY, true, Phone, Image):-
budget_accommodation(AC, CITY, Phone, Image),
hotel(AC, CITY, Phone, Image).
%FamilyDestination
family_destination(AC, CITY, true, Phone, Image):-
(accommodation(AC, CITY, Phone, Image),
activity(AC, CITY, true)). %ISSUE: É necessário 2 ou mais atividades, como solicitar isso aqui????
%QuietDestination
quiet_destination(AC, CITY, Phone, Image):-
family_destination(AC, CITY, true, Phone, Image). %ISSUE: Deveria ser not family_destination porém só retorna false, o que fazer?
%RetireeDestination
retiree_destination(AC, CITY, Phone, Image):-
accommodation(AC, CITY, Phone, Image),
three_s(AC, CITY, true),
sightseeing(AC, CITY).
%RuralArea
%NationalPark
national_park(AC, CITY, Phone, Image):-
campground(AC, CITY, Phone, Image),
hiking(AC, CITY, true).
rural_area(AC, CITY, true):-
farm_land(AC, CITY, true);
national_park(AC, CITY, true).
%UrbanArea
%City
city(AC, CITY):-
luxury_hotel(AC, CITY).
capital(AC, CITY):-
city(AC, CITY),
museums(AC, CITY, true).
urban_area(AC, CITY):-
city(AC, CITY);
town(AC, CITY, true).