Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
example
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
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
SMAC
AMAK
Python
PyAMAK
example
Commits
f557b3d8
Commit
f557b3d8
authored
4 years ago
by
Jdrezen
Browse files
Options
Downloads
Patches
Plain Diff
Modification pour tester les courbes
parent
01cd8b26
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
philosopher_example/controleurPhilosophersExample.py
+16
-14
16 additions, 14 deletions
philosopher_example/controleurPhilosophersExample.py
with
16 additions
and
14 deletions
philosopher_example/controleurPhilosophersExample.py
+
16
−
14
View file @
f557b3d8
...
@@ -11,8 +11,8 @@ class ControleurPhilosophersExample(Controleur):
...
@@ -11,8 +11,8 @@ class ControleurPhilosophersExample(Controleur):
self
.
__numberPhilosopher
=
10
self
.
__numberPhilosopher
=
10
self
.
__barChart
=
[]
self
.
__barChart
=
[]
self
.
__barChart
.
append
(
self
.
addBarChart
(
'
Eaten Pastas
'
))
self
.
__barChart
.
append
(
self
.
addBarChart
(
'
Eaten Pastas
'
))
#
self.__barChart.append(self.addBarChart('Hours of tkinking'))
self
.
__barChart
.
append
(
self
.
addBarChart
(
'
Hours of tkinking
'
))
#
self.__barChart.append(self.add
Bar
Chart('Hours of hunger'))
self
.
__barChart
.
append
(
self
.
add
Plot
Chart
(
'
Hours of hunger
'
))
def
initialisation
(
self
):
def
initialisation
(
self
):
...
@@ -22,16 +22,16 @@ class ControleurPhilosophersExample(Controleur):
...
@@ -22,16 +22,16 @@ class ControleurPhilosophersExample(Controleur):
# Init
# Init
self
.
setTitle
(
self
.
__barChart
[
0
],
'
Eaten Pastas
'
)
self
.
setTitle
(
self
.
__barChart
[
0
],
'
Eaten Pastas
'
)
#
self.setXLabel(self.__barChart[0],'Philosophers')
self
.
setXLabel
(
self
.
__barChart
[
0
],
'
Philosophers
'
)
#
self.setYLabel(self.__barChart[0],'Number of eaten pastas')
self
.
setYLabel
(
self
.
__barChart
[
0
],
'
Number of eaten pastas
'
)
#
self.setTitle(self.__barChart[1],'Hours of thinking')
self
.
setTitle
(
self
.
__barChart
[
1
],
'
Hours of thinking
'
)
#
self.setXLabel(self.__barChart[1],'Philosophers')
self
.
setXLabel
(
self
.
__barChart
[
1
],
'
Philosophers
'
)
#
self.setYLabel(self.__barChart[1],'Hours')
self
.
setYLabel
(
self
.
__barChart
[
1
],
'
Hours
'
)
#
self.setTitle(self.__barChart[2],'Hours of hunger')
self
.
setTitle
(
self
.
__barChart
[
2
],
'
Hours of hunger
'
)
#
self.setXLabel(self.__barChart[2],'Philosophers')
self
.
setXLabel
(
self
.
__barChart
[
2
],
'
Philosophers
'
)
#
self.setYLabel(self.__barChart[2],'Hours')
self
.
setYLabel
(
self
.
__barChart
[
2
],
'
Hours
'
)
self
.
draw_text
(
40
,
15
,
"
EATING
"
)
self
.
draw_text
(
40
,
15
,
"
EATING
"
)
self
.
draw_text
(
40
,
45
,
"
THINKING
"
)
self
.
draw_text
(
40
,
45
,
"
THINKING
"
)
...
@@ -51,10 +51,12 @@ class ControleurPhilosophersExample(Controleur):
...
@@ -51,10 +51,12 @@ class ControleurPhilosophersExample(Controleur):
self
.
__philosophers
.
append
(
carre
)
self
.
__philosophers
.
append
(
carre
)
nom
=
'
Mr
'
+
str
(
i
)
nom
=
'
Mr
'
+
str
(
i
)
self
.
addPoint
(
self
.
__barChart
[
0
],
x
,
y
)
#self.addColumn(self.__barChart[0],nom)
self
.
addColumn
(
self
.
__barChart
[
0
],
nom
)
#self.addColumn(self.__barChart[1],nom)
self
.
addColumn
(
self
.
__barChart
[
1
],
nom
)
#self.addColumn(self.__barChart[2],nom)
self
.
addPoint
(
self
.
__barChart
[
2
],
0
,
x
,
y
)
self
.
addCurve
(
self
.
__barChart
[
2
],
'
go
'
)
self
.
addPoint
(
self
.
__barChart
[
2
],
1
,
x
-
10
,
y
-
10
)
def
updateCycle
(
self
,
env
,
amas
):
def
updateCycle
(
self
,
env
,
amas
):
agents
=
amas
.
get_Agents_Sorted
()
agents
=
amas
.
get_Agents_Sorted
()
...
...
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