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
db6d1987
Commit
db6d1987
authored
1 year ago
by
Balthazar Wilson
Browse files
Options
Downloads
Patches
Plain Diff
readme
parent
4394ddb9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/launch-all-rest-agents/launch-all-agents.go
+0
-42
0 additions, 42 deletions
cmd/launch-all-rest-agents/launch-all-agents.go
readme.md
+1
-2
1 addition, 2 deletions
readme.md
with
1 addition
and
44 deletions
cmd/launch-all-rest-agents/launch-all-agents.go
deleted
100644 → 0
+
0
−
42
View file @
4394ddb9
package
main
import
(
"fmt"
"log"
"math/rand"
ba
"gitlab.utc.fr/gvandevi/ia04binome2a/agt/ballotagent"
va
"gitlab.utc.fr/gvandevi/ia04binome2a/agt/voteragent"
)
func
main
()
{
const
n
=
100
const
url1
=
":8080"
const
url2
=
"http://localhost:8080"
ops
:=
[
...
]
string
{
"+"
,
"-"
,
"*"
}
clAgts
:=
make
([]
va
.
RestClientAgent
,
0
,
n
)
servAgt
:=
ba
.
NewBallotServerAgent
(
url1
)
log
.
Println
(
"démarrage du serveur..."
)
go
servAgt
.
Start
()
log
.
Println
(
"démarrage des clients..."
)
for
i
:=
0
;
i
<
n
;
i
++
{
id
:=
fmt
.
Sprintf
(
"id%02d"
,
i
)
op
:=
ops
[
rand
.
Intn
(
3
)]
op1
:=
rand
.
Intn
(
100
)
op2
:=
rand
.
Intn
(
100
)
agt
:=
va
.
NewRestClientAgent
(
id
,
url2
,
op
,
op1
,
op2
)
clAgts
=
append
(
clAgts
,
*
agt
)
}
for
_
,
agt
:=
range
clAgts
{
// attention, obligation de passer par cette lambda pour faire capturer la valeur de l'itération par la goroutine
func
(
agt
va
.
RestClientAgent
)
{
go
agt
.
Start
()
}(
agt
)
}
fmt
.
Scanln
()
}
This diff is collapsed.
Click to expand it.
readme.md
+
1
−
2
View file @
db6d1987
...
@@ -6,9 +6,8 @@ Les votants peuvent faire des requêtes pour voter dans les scrutins qui le conc
...
@@ -6,9 +6,8 @@ Les votants peuvent faire des requêtes pour voter dans les scrutins qui le conc
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
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
3
exécutables (indépendants) sont fournis :
2
exécutables (indépendants) sont fournis :
*
`launch-all-rest-agents`
permet de lancer une démo avec un seul exécutable
*
`launch-bagt`
permet de lancer un agent de type serveur de vote
*
`launch-bagt`
permet de lancer un agent de type serveur de vote
*
`launch-vagt`
permet de lancer un agent de type votant
*
`launch-vagt`
permet de lancer un agent de type votant
...
...
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