Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
projet_s6_loic.scoth.etu_mamadulamarana.bah.etu
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
Loic Scoth
projet_s6_loic.scoth.etu_mamadulamarana.bah.etu
Commits
0908de92
Commit
0908de92
authored
1 year ago
by
Loic Scoth
Browse files
Options
Downloads
Patches
Plain Diff
experimentation
parent
147b13b0
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/ArbreB/Graph.gv
+61
-1
61 additions, 1 deletion
src/ArbreB/Graph.gv
src/ArbreB/Graph.gv.jpg
+0
-0
0 additions, 0 deletions
src/ArbreB/Graph.gv.jpg
src/Visualization.py
+2
-3
2 additions, 3 deletions
src/Visualization.py
src/experimentation.py
+25
-18
25 additions, 18 deletions
src/experimentation.py
with
88 additions
and
22 deletions
src/ArbreB/Graph.gv
+
61
−
1
View file @
0908de92
graph {
"[5, 25]"
"[14]"
"[6, 10]"
"[14]" -- "[6, 10]"
"[6, 10]"
"[4]"
"[6, 10]" -- "[4]"
"[4]"
"[2]"
"[4]" -- "[2]"
"[2]"
"[5]"
"[4]" -- "[5]"
"[5]"
"[8]"
"[6, 10]" -- "[8]"
"[8]"
"[7]"
"[8]" -- "[7]"
"[7]"
"[9]"
"[8]" -- "[9]"
"[9]"
"[12]"
"[6, 10]" -- "[12]"
"[12]"
"[11]"
"[12]" -- "[11]"
"[11]"
"[13]"
"[12]" -- "[13]"
"[13]"
"[22, 30]"
"[14]" -- "[22, 30]"
"[22, 30]"
"[18]"
"[22, 30]" -- "[18]"
"[18]"
"[16]"
"[18]" -- "[16]"
"[16]"
"[20]"
"[18]" -- "[20]"
"[20]"
"[26]"
"[22, 30]" -- "[26]"
"[26]"
"[24]"
"[26]" -- "[24]"
"[24]"
"[28]"
"[26]" -- "[28]"
"[28]"
"[34]"
"[22, 30]" -- "[34]"
"[34]"
"[32]"
"[34]" -- "[32]"
"[32]"
"[36]"
"[34]" -- "[36]"
"[36]"
}
This diff is collapsed.
Click to expand it.
src/ArbreB/Graph.gv.jpg
+
0
−
0
View replaced file @
147b13b0
View file @
0908de92
2.7 KiB
|
W:
|
H:
42.3 KiB
|
W:
|
H:
2-up
Swipe
Onion skin
This diff is collapsed.
Click to expand it.
src/Visualization.py
+
2
−
3
View file @
0908de92
...
...
@@ -11,15 +11,14 @@ class Visualization() :
self
.
add_node_to_graph
(
self
.
btree
.
root
)
def
add_node_to_graph
(
self
,
node
):
# nodeKeys = repr(node.keys)
print
(
repr
(
node
.
keys
))
# print(repr(node.keys))
nodeKeys
=
repr
(
node
.
keys
)
self
.
g
.
node
(
nodeKeys
)
for
child
in
node
.
childs
:
childKeys
=
repr
(
child
.
keys
)
self
.
g
.
node
(
childKeys
)
self
.
g
.
edge
(
nodeKeys
,
childKeys
)
self
.
add_node_to_graph
(
child
Keys
)
self
.
add_node_to_graph
(
child
)
def
render
(
self
):
self
.
g
.
format
=
'
jpg
'
...
...
This diff is collapsed.
Click to expand it.
src/experimentation.py
+
25
−
18
View file @
0908de92
...
...
@@ -6,36 +6,41 @@ from BTree import Btree
class
experimentation
:
def
__init__
(
self
):
def
__init__
(
self
,
exp
):
self
.
btree
=
Btree
(
2
,
Node
([]))
self
.
experimentationInsert1
()
def
experimentationInsert1
(
self
):
#self.btree.insertion(2)
#self.isCorrect(Btree(2,Node([2])))
#self.btree.insertion(4)
#self.isCorrect(Btree(2,Node([2,4])))
if
exp
==
"
1
"
:
self
.
experimentationInsert1
()
elif
"
2
"
:
self
.
experimentationSuppr1
()
else
:
None
def
experimentationInsert1
(
self
):
for
n
in
[
2
,
4
,
5
]
+
list
(
range
(
6
,
37
,
2
))
+
[
7
,
9
,
11
,
13
]:
self
.
btree
.
insertion
(
n
)
#
Visualization(self.btree).render()
Visualization
(
self
.
btree
).
render
()
print
(
self
.
btree
)
def
experimentationSuppr1
(
self
):
for
n
in
[
2
,
4
,
5
]
+
list
(
range
(
6
,
37
,
2
))
+
[
7
,
9
,
11
,
13
]:
self
.
btree
.
insertion
(
n
)
#for n in [14,10,20,18,16,24,6]
def
isCorrect
(
self
,
BTreeTest
):
if
(
self
.
btree
.
equals
(
BTreeTest
)):
print
(
"
Correct
"
)
else
:
print
(
"
error
"
)
# fonction temporaire pour tester la correspondance des arbres de manière automatique et simple visuellement
#
def isCorrect(self, BTreeTest):
#
if (self.btree.equals(BTreeTest)):
#
print("Correct")
#
else:
#
print("error")
...
...
@@ -49,7 +54,9 @@ class experimentation:
if
__name__
==
"
__main__
"
:
experiment
=
experimentation
()
response
=
input
(
"
Quelle expérimentation voulez vous (1 ou 2)
"
)
experiment
=
experimentation
(
response
)
...
...
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