Last change
on this file since 3f5bf9e was d509a04, checked in by Vzdra <vladko.zdravkovski@…>, 4 years ago |
added simple matchmaker function for skill coefficient
|
-
Property mode
set to
100644
|
File size:
452 bytes
|
Rev | Line | |
---|
[d509a04] | 1 | package it.finki.tinki.helper;
|
---|
| 2 |
|
---|
| 3 | import it.finki.tinki.model.Skill;
|
---|
| 4 | import java.util.List;
|
---|
| 5 |
|
---|
| 6 | public class Matchmaker {
|
---|
| 7 |
|
---|
| 8 | public float match(List<Skill> work, List<Skill> user){
|
---|
| 9 |
|
---|
| 10 | float coef = work.size();
|
---|
| 11 | float k = 0;
|
---|
| 12 |
|
---|
| 13 | for (Skill skill : work) {
|
---|
| 14 | for (Skill value : user) {
|
---|
| 15 | if (value.equals(skill)) {
|
---|
| 16 | k++;
|
---|
| 17 | }
|
---|
| 18 | }
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | return k/coef;
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.