hey guy, im trying to build a recommendation system for computer hardware. For now i just want to ask for a game that the user wants to be able to play on his new system and and suggest him a graphiccard and a cpu. So for example he says “minecraft” and minecraft needs 2GB Graphics memory and a processor with 4 cores and 3.9 clockrate. Now i have some different CPUs and GPUs implemented as facts. Obviously there is not everytime a hardware that matches the requirements 100% so i want to give the user the one, that matches the best. So if he needs 3.9 clockrate prolog should also answer with one that has 4.0 if no with 3.9 is available. For now my code only works, if there is one hardware that matches 100% the requierements.
here is my code:
/*Marke,Modell,Kerne,Turbotakt,Prozessorgrafik(true,false),max-ram*/
prozessor(intel,'i7-11850HE',8,4.7,true,128).
prozessor(intel,'i7-8750H',6,4.1,true,64).
prozessor(intel,'i5-8400',6,4.0,true,128).
prozessor(intel,'i3-3220',2,3.3,true,32).
prozessor(amd,'ryzen 5 3600',6,4.2,false,128).
prozessor(amd,'ryzen threadripper 3990X',64,4.3,false,256).
/*marke,modell,grafikspeicher*/
grafikkarte(nvidia,'geforce gtx 1050',2).
grafikkarte(nvidia,'geforce gtx 1050 ti', 4).
grafikkarte(nvidia,'geforce rtx 2080',8).
grafikkarte(nvidia,'geforce rtx 3080',10).
/*Spiele specs (name,ram, gpu, speicher, Kerne, Takt)
*/
spiel('cyberpunk 2077',12,6,70,4,4.0).
spiel('valorant',4,4,8,4,3.4).
spiel('warzone',12,6,175,6,3.7).
spiel('gtav',8,2,72,4,3.6).
spiel('minecraft',4,2,4,4,3.9).
/*Programme kerne,takt, gpuspeicher, ram, speicher*/
programm('photoshop',2.0,2,4,8,4).
programm('after effects',4,3.0,16,4,15). /*32 Ram bei 4K*/
programm('premiere pro',8, 4.0,16,4,8). /*32 Ram bei 4K*/
programm('blender',4, 4.0, 16, 6,0).
go:-
write("Office,Gaming oder Arbeit?"),
read(Typ),
(Typ == 'gaming' ->
write("Sie möchten also einen GamingPc, welche Spiele möchten Sie spielen?"),nl,
read(Game1),nl,
spiel(Game1,A,Y,B,X,Z),
grafikkarte(V,W,Y),
prozessor(Name,Modell,X,Z,Grafik,Ram),
write("Unsere Empfehlung:"), write(V), write(W), write(" mit "), write(Y), write("GB Grafikspeicher"),nl,
write(Name),write(Modell)
;
Typ == 'office' -> write("office");
Typ == 'arbeit' -> write("workstation"); false).