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
Compare revisions
2e2dbc082b25383c865d53ea09f641f6b9e57ea1 to main
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
gvandevi/ia04binome2a
Select target project
No results found
main
Select Git revision
Swap
Target
wilsonba/polling-server-ia-04
Select target project
wilsonba/polling-server-ia-04
gvandevi/ia04binome2a
2 results
2e2dbc082b25383c865d53ea09f641f6b9e57ea1
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
main.go
+0
-13
0 additions, 13 deletions
main.go
readme.md
+27
-0
27 additions, 0 deletions
readme.md
types.go
+29
-0
29 additions, 0 deletions
types.go
with
56 additions
and
13 deletions
main.go
deleted
100644 → 0
View file @
2e2dbc08
package
main
import
(
"gitlab.utc.fr/gvandevi/ia04/comsoc"
)
func
main
(){
//Fonctions utilitaires
//comsoc.Test_rank()
//comsoc.Test_maxCount()
//comsoc.Test_checkProfile()
comsoc
.
Test_checkProfileAlternative
()
}
This diff is collapsed.
Click to expand it.
readme.md
0 → 100644
View file @
49fb53d9
# Serveur de vote Rest en Go
Le serveur permet de créer des scrutins suivants plusieures méthodes de vote.
Les votants peuvent faire des requêtes pour voter dans les scrutins qui le concernent
Toutes les requêtes doivent suivre la norme suivante : https://gitlab.utc.fr/lagruesy/ia04/-/blob/main/docs/sujets/activit%C3%A9s/serveur-vote/api.md
2 exécutables (indépendants) sont fournis :
*
`launch-bagt`
permet de lancer un agent de type serveur de vote
*
`launch-vagt`
permet de lancer un agent de type votant
Il est possible d'avoir accès à ces commandes en les installant ainsi :
`go install gitlab.utc.fr/gvandevi/ia04binome2a/cmd/launch-bagt`
Méthodes de vote implémentées :
*
Majorité
*
Approval
*
Borda
*
Copeland
*
STV
Agents implémentés :
*
Serveur
*
Votants (paramètres à modifier en fonction du scrutin créé auprès du serveur)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
types.go
0 → 100644
View file @
49fb53d9
package
ia04binome2a
type
BallotRequest
struct
{
Rule
string
`json:"rule"`
Deadline
string
`json:"deadline"`
VotersID
[]
string
`json:"voters-id"`
NbAlts
int
`json:"#alts"`
TieBreak
[]
int
`json:"tie-break"`
}
type
Vote
struct
{
AgentID
string
`json:"agent-id"`
BallotID
string
`json:"ballot-id"`
Prefs
[]
int
`json:"prefs"`
Options
[]
int
`json:"options"`
}
type
Ballot
struct
{
BallotID
string
`json:"ballot-id"`
}
type
ResultResponse
struct
{
Winner
int
`json:"winner"`
Ranking
[]
int
`json:"ranking"`
}
type
Request
interface
{
BallotRequest
|
Ballot
|
Vote
}
This diff is collapsed.
Click to expand it.
Prev
1
2
Next