简体   繁体   English

根据用户答案从数据库中选择宠物品种/汽车/自行车/等的算法

[英]Algorithm to select pet breed / cars / bikes / etc from database based on user answers

This quesiton is more about getting a point in the right direction. 这个问题更多的是在正确的方向上找到一个点。 I inherited and developed upon a project to create a car selection database (matching user preferences). 我继承并开发了一个项目来创建汽车选择数据库(匹配用户首选项)。 It is already working relatively well but could be better (there are a few issues), so I'd like to study some other algorithms used by others. 它已经相对较好地工作但可能更好(有一些问题),所以我想研究其他人使用的其他算法。 The site I'm working on uses a best match algorithm where each car is assigned a "1" each time it matches a quesiton answered and these are added up. 我正在研究的网站使用了一种最佳匹配算法,每次匹配问题时,每辆汽车都会被分配一个“1”并将这些匹配起来。

I like in particular, the following site (to select dog breeds): 我特别喜欢以下网站(选择犬种):

http://animal.discovery.com/breed-selector/dog-breeds.html http://animal.discovery.com/breed-selector/dog-breeds.html

Can anyone point me in the right direction as to where I might find something similar (I've been looking, but probably not looking in the right places or using the right search terms)? 任何人都可以指出我正确的方向,我可能会找到类似的东西(我一直在寻找,但可能没有找到正确的地方或使用正确的搜索条件)? I'd like to be able to view and study the algorithm used (PHP/mySQL). 我希望能够查看和研究使用的算法(PHP / mySQL)。

The (incomplete) site I'm working on: 我正在处理的(不完整的)网站:

http://www.myperfectcar.com.ph/ http://www.myperfectcar.com.ph/

Any help would be much appreciated. 任何帮助将非常感激。 Thanks. 谢谢。

It is exactly as any other filter with dropdowns, except that it is implemented in wizard-like form. 它与任何其他具有下拉列表的过滤器完全相同,只是它以类似向导的形式实现。 You need to have some class, in session with more-less such structure: 你需要有一些类,在会话中使用更多这样的结构:

public class CarSearchWizard
{
    public int Passengiers = 0;
    public int DrivingFor = 0;
    ...
}

I didn't notice that your search depends on previous selection, so it is rather simple - filter for number of people, driving etc on each iteration of user search. 我没有注意到你的搜索取决于之前的选择,因此它非常简单 - 在每次用户搜索迭代时过滤人数,驾驶等。 I think your algorythm is ok, except it is rather long to fulfill :) 我认为你的algorythm是好的,除了它实现相当长的时间:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM