source:
src/main/java/it/finki/tinki/helper/Matchmaker.java@
17abe5e
Last change on this file since 17abe5e was 336d09e, checked in by , 3 years ago | |
---|---|
|
|
File size: 557 bytes |
Rev | Line | |
---|---|---|
[d509a04] | 1 | package it.finki.tinki.helper; |
2 | ||
3 | import it.finki.tinki.model.Skill; | |
[509cb95] | 4 | import org.springframework.stereotype.Component; |
5 | ||
[d509a04] | 6 | import java.util.List; |
7 | ||
[509cb95] | 8 | @Component |
[d509a04] | 9 | public class Matchmaker { |
10 | ||
[509cb95] | 11 | public static float match(List<Skill> work, List<Skill> user){ |
[d509a04] | 12 | |
13 | float coef = work.size(); | |
14 | float k = 0; | |
15 | ||
16 | for (Skill skill : work) { | |
17 | for (Skill value : user) { | |
18 | if (value.equals(skill)) { | |
19 | k++; | |
20 | } | |
21 | } | |
22 | } | |
23 | ||
[336d09e] | 24 | System.out.println(k/coef); |
25 | ||
[d509a04] | 26 | return k/coef; |
27 | } | |
28 | ||
29 | } |
Note:
See TracBrowser
for help on using the repository browser.