Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Guillaume Sabbagh
Modification de categories
Commits
96465e81
Commit
96465e81
authored
Jun 15, 2021
by
Guillaume Sabbagh
Browse files
merge
parents
dc36ca9d
06731fa7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Cluster.py
View file @
96465e81
...
...
@@ -205,7 +205,9 @@ class CategorieClusters(CategorieInteractions):
result
=
set
()
for
source
in
sources
:
for
cible
in
cibles
:
print
(
source
,
cible
)
interactions
=
CategorieInteractions
.
__call__
(
self
,{
source
},{
cible
})
print
(
source
,
cible
)
proto_cluster_maximaux
=
set
()
while
len
(
interactions
)
>
0
:
interact
=
interactions
.
pop
()
...
...
EnsFinis.py
View file @
96465e81
...
...
@@ -86,9 +86,9 @@ class CategorieEnsemblesFinis(Categorie):
for
a
in
sources
:
for
b
in
cibles
:
if
not
issubclass
(
type
(
a
),
frozenset
):
raise
Exception
(
"On s'attend à avoir des frozenset dans l'ensemble source, pas un "
+
str
(
type
(
a
))
+
'
\n
'
+
str
(
source
))
raise
Exception
(
"On s'attend à avoir des frozenset dans l'ensemble source, pas un "
+
str
(
type
(
a
))
+
'
\n
'
+
str
(
source
s
))
if
not
issubclass
(
type
(
b
),
frozenset
):
raise
Exception
(
"On s'attend à avoir des frozenset dans l'ensemble cible, pas un "
+
str
(
type
(
b
))
+
'
\n
'
+
str
(
cible
))
raise
Exception
(
"On s'attend à avoir des frozenset dans l'ensemble cible, pas un "
+
str
(
type
(
b
))
+
'
\n
'
+
str
(
cible
s
))
result
|=
{
Application
(
a
,
b
,
dict
(
zip
(
a
,
prod
)))
for
prod
in
itertools
.
product
(
b
,
repeat
=
len
(
a
))}
return
result
...
...
ExemplesCategories.py
View file @
96465e81
...
...
@@ -28,15 +28,14 @@ c_p2 = ChampActif(d2)
# c_p1.transformer_graphviz()
sous_c_p1
=
SousCategoriePleine
(
c_p1
,
c_p1
.
objets_colimites
())
sous_c_p1
.
transformer_graphviz
()
#
sous_c_p1 = SousCategoriePleine(c_p1,c_p1.objets_colimites())
#
sous_c_p1.transformer_graphviz()
sous_c_p2
=
SousCategoriePleine
(
c_p2
,
c_p2
.
objets_colimites
())
sous_c_p2
.
transformer_graphviz
()
#
sous_c_p2 = SousCategoriePleine(c_p2,c_p2.objets_colimites())
#
sous_c_p2.transformer_graphviz()
# cat_hom = CategorieHomologue({sous_c_p1,sous_c_p2}) #on cherche simplement un isomoprhisme entre les colimites pour dire qu'ils ont les mêmes colimites
# print("cat_hom")
# cat_hom.transformer_graphviz()
from
Cluster
import
CategorieClusters
cat_clust
=
CategorieClusters
({
d1
,
d2
})
\ No newline at end of file
cat_clust
=
CategorieClusters
(
cat
,{
d1
,
d2
})
SousCategoriePleine
(
cat_clust
.
transformer_graphviz
(),{
d1
,
d2
}).
transformer_graphviz
()
\ No newline at end of file
Interaction.py
View file @
96465e81
...
...
@@ -122,7 +122,7 @@ class CategorieInteractions(Categorie):
"""
Categorie
.
__init__
(
self
,
diagrammes
,
"Catégorie des diagrammes et interactions sur "
+
str
(
univers
)
if
nom
==
None
else
nom
)
self
.
univers
=
univers
self
|=
{
DiagrammeObjets
(
univers
,
obj
)
for
obj
in
univers
.
objets
}
self
|=
{
DiagrammeObjets
(
univers
,
{
obj
}
)
for
obj
in
univers
.
objets
}
if
config
.
TOUJOURS_VERIFIER_COHERENCE
:
self
.
verifier_coherence
()
...
...
@@ -138,7 +138,8 @@ class CategorieInteractions(Categorie):
for
b
in
cibles
:
if
a
.
cible
!=
b
.
cible
:
raise
Exception
(
"Les deux diagrammes n'ont pas la même catégorie cible"
)
fleches
=
{
ObjetCommaCategorie
(
i
,
f
,
j
)
for
i
in
a
.
source
.
objets
for
j
in
b
.
source
.
objets
for
f
in
a
.
cible
(
a
(
i
),
b
(
j
))}
fleches
=
{
ObjetCommaCategorie
(
i
,
f
,
j
)
for
i
in
a
.
source
.
objets
for
j
in
b
.
source
.
objets
for
f
in
a
.
cible
({
a
(
i
)},{
b
(
j
)})}
print
(
len
(
fleches
)
+
1
)
for
k
in
range
(
1
,
len
(
fleches
)
+
1
):
for
combi
in
itertools
.
combinations
(
fleches
,
k
):
result
|=
{
Interaction
(
a
,
b
,
set
(
combi
))}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment