Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Projet de synthèse
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
SAILLOT Lyo
Projet de synthèse
Commits
b931337e
Commit
b931337e
authored
1 year ago
by
LAMM Thibaut
Browse files
Options
Downloads
Patches
Plain Diff
modif
parent
da74f248
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
script/generate_instance.sh
+10
-21
10 additions, 21 deletions
script/generate_instance.sh
with
10 additions
and
21 deletions
script/generate_instance.sh
+
10
−
21
View file @
b931337e
...
@@ -99,32 +99,21 @@ density=$3 # paramètre qui décrit la densité du graphe
...
@@ -99,32 +99,21 @@ density=$3 # paramètre qui décrit la densité du graphe
declare
-A
tab
declare
-A
tab
nb_aretes
=
0
nb_aretes
=
0
while
[
$nb_aretes
-le
$density
]
for
i
in
$(
seq
-w
$n
)
do
do
echo
"
$arete
"
for
j
in
$(
seq
-w
$n
)
for
i
in
$(
seq
-w
$n
)
do
do
for
j
in
$(
seq
-w
$n
)
arete
=
$(
getNormalDistributionSample 0 100
)
do
if
[
$arete
-le
$density
]
if
[
$i
-ne
$j
]
&&
[
$nb_aretes
-le
$density
]
then
then
tab[
"
$i
$j
"
]=
$(
getParetoDistributionSample
)
arete
=
$(
getNormalDistributionSample 0 100
)
nb_aretes
=
$((
nb_aretes+1
))
if
[
$arete
-le
$density
]
fi
then
if
[
-z
"
${
tab
[
$j
$i
]
}
"
]
&&
[
-z
"
${
tab
[
$j
$i
]
}
"
]
then
tab[
"
$i
$j
"
]=
$(
getParetoDistributionSample
)
nb_aretes
=
$((
nb_aretes+1
))
fi
fi
fi
done
done
done
done
done
# ÉCRITURE DES DONNÉES GÉNÉRÉES AU FICHIER
# ÉCRITURE DES DONNÉES GÉNÉRÉES AU FICHIER
#
#
# Format du fichier donné à la présentation du cours
# Format du fichier donné à la présentation du cours
...
@@ -139,7 +128,7 @@ do
...
@@ -139,7 +128,7 @@ do
done
done
# écrire le nombre d'arêtes
# écrire le nombre d'arêtes
echo
"
$
density
"
>>
$filename
echo
"
$
nb_aretes
"
>>
$filename
# écrire les arêtes avec leurs distances
# écrire les arêtes avec leurs distances
for
elt
in
"
${
!tab[@]
}
"
for
elt
in
"
${
!tab[@]
}
"
...
...
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