Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IA04binôme2A
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gabrielle Van De Vijver
IA04binôme2A
Commits
eed5bbca
Commit
eed5bbca
authored
1 year ago
by
Gabrielle Van De Vijver
Committed by
Balthazar Wilson
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fonction borda et test
parent
01e78215
No related branches found
No related tags found
1 merge request
!7
Partie serveur
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
comsoc/Borda.go
+30
-1
30 additions, 1 deletion
comsoc/Borda.go
with
30 additions
and
1 deletion
comsoc/Borda.go
+
30
−
1
View file @
eed5bbca
package
comsoc
\ No newline at end of file
package
comsoc
import
(
"fmt"
)
func
BordaSWF
(
p
Profile
)
(
count
Count
,
err
error
){
count
=
make
(
Count
)
nAlts
:=
len
(
p
[
0
])
for
_
,
row
:=
range
p
{
for
i
:=
0
;
i
<
nAlts
;
i
++
{
count
[
row
[
i
]]
+=
nAlts
-
i
}
}
return
count
,
nil
}
func
BordaSCF
(
p
Profile
)
(
bestAlts
[]
Alternative
,
err
error
)
{
count
,
err
:=
BordaSWF
(
p
)
if
err
!=
nil
{
return
nil
,
err
}
return
maxCount
(
count
),
nil
}
func
Test_borda
(){
profil
:=
GenerateProfile
(
3
,
5
)
fmt
.
Println
(
"Profil :"
,
profil
)
count
,
_
:=
BordaSWF
(
profil
)
fmt
.
Println
(
"Décompte :"
,
count
)
winners
,
_
:=
BordaSCF
(
profil
)
fmt
.
Println
(
"Vainqueur(s) :"
,
winners
)
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment