Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JAAMAS-2024
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
MOSART
publications
JAAMAS-2024
Commits
1c1ed65f
Commit
1c1ed65f
authored
1 year ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
update requirements.txt
parent
2312c92f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
requirements.txt
+1
-0
1 addition, 0 deletions
requirements.txt
results/requirements.txt
+0
-4
0 additions, 4 deletions
results/requirements.txt
run_experiments.sh
+0
-126
0 additions, 126 deletions
run_experiments.sh
with
3 additions
and
130 deletions
.gitignore
+
2
−
0
View file @
1c1ed65f
...
...
@@ -13,3 +13,5 @@ optim_generator
# IPython
profile_default/
ipython_config.py
.DS_Store
This diff is collapsed.
Click to expand it.
requirements.txt
+
1
−
0
View file @
1c1ed65f
jupyter
pandas
plotly
kaleido
\ No newline at end of file
This diff is collapsed.
Click to expand it.
results/requirements.txt
deleted
100644 → 0
+
0
−
4
View file @
2312c92f
jupyter
plotly==5.11.0
pandas
kaleido
\ No newline at end of file
This diff is collapsed.
Click to expand it.
run_experiments.sh
deleted
100755 → 0
+
0
−
126
View file @
2312c92f
#!/bin/bash
################################################
# Script for generating experiments table #
# Author: Laure Petrucci #
# Version: 1.0 #
# Date: 2022-10-22 #
################################################
function
usage
{
echo
-e
"
\0
33[1;31musage
\0
33[0m:
$0
[-h | [-v maxvoters] [-a maxagents] [-c maxcandidates] [-s one|all] [-t timeout] [-x] -o table_filename]"
}
function
help
{
echo
-e
""
usage
echo
-e
"
\n
Executes the experiments.
\n
The result is written in the file specified with the
\0
33[1m-o
\0
33[0m option"
echo
-e
"
\n\0
33[1m-h
\0
33[0m
\t\t
This help"
echo
-e
"
\n\0
33[1m-v maxvoters
\0
33[0m
\t
Uses a specified value for the maximal number of voters
\0
33[4m[default:
$maxvoters
]
\0
33[0m"
echo
-e
"
\n\0
33[1m-a maxagents
\0
33[0m
\t
Uses a specified value for the maximal number of agents
\0
33[4m[default:
$maxagents
]
\0
33[0m"
echo
-e
"
\n\0
33[1m-c maxcandidates
\0
33[0m Uses a specified value for the maximal number of candidates
\0
33[4m[default:
$maxcandidates
]
\0
33[0m"
echo
-e
"
\n\0
33[1m-s strategy
\0
33[0m
\t
Find one strategy or all of them
\0
33[4m[default: one]
\0
33[0m"
echo
-e
"
\n\0
33[1m-t timeout
\0
33[0m
\t
Uses a specified value for the timeout (in seconds)
\0
33[4m[default:
$timeout
]
\0
33[0m"
echo
-e
"
\n\0
33[1m-x
\0
33[0m
\t\t
Uses an optimisation
\0
33[4m[default:
$optim_gen
]
\0
33[0m"
exit
}
function
process_results
{
exceeds_time
=
$(
grep
"time limit"
$one_result
)
if
[
-z
"
$exceeds_time
"
]
;
then
echo
-n
$(
grep
"completed after"
$one_result
|
sed
-e
's/\[EF\] Algorithm completed after //'
|
sed
-e
's/ seconds.//'
|
sed
-e
's/ second.//'
|
sed
-e
's/\[0m//'
)
>>
$output_file
else
echo
-n
"TO"
>>
$output_file
fi
}
# main part of the script
imitator
=
"./tools/imitator/imitator-
$(
uname
)
-
$(
uname
-m
)
"
if
!
command
-v
$imitator
&>/dev/null
;
then
echo
"Imitator cannot be found. Please set its PATH in the imitator variable"
exit
fi
# get the options
timeout
=
120
# 2 minutes by default
maxvoters
=
3
# default max values for generation
maxcandidates
=
4
maxagents
=
2
output_file
=
strategy
=
one
optim_gen
=
'false'
while
getopts
"ht:o:v:a:c:s:x"
opt
;
do
case
$opt
in
h
)
help
;;
t
)
timeout
=
$OPTARG
;;
o
)
output_file
=
$OPTARG
;;
v
)
maxvoters
=
$OPTARG
;;
a
)
maxagents
=
$OPTARG
;;
c
)
maxcandidates
=
$OPTARG
;;
s
)
strategy
=
$OPTARG
;;
x
)
optim_gen
=
'true'
;;
esac
done
if
[
-z
"
$output_file
"
]
;
then
usage
exit
fi
# select generator
if
${
optim_gen
}
;
then
generator
=
"./tools/voters_generator/optim_generator"
name_base
=
"candOptStrat"
else
generator
=
"./tools/voters_generator/generator"
name_base
=
"candStrat"
fi
if
!
command
-v
$generator
&>/dev/null
;
then
echo
"compiling the generator tool ..."
(
cd
tools/voters_generator
&&
make
)
fi
imitator_options
=
"-no-output-result -merge=none -time-limit=
$timeout
"
extension
=
".
${
output_file
##*.
}
"
one_result
=
"
$(
basename
$output_file
$extension
)
.tmp"
rm
-f
$one_result
rm
-f
$output_file
# print the command line that was used
echo
$0
$*
>
$output_file
# print csv header
echo
''
>>
$output_file
echo
-n
"agents;strategy;timeout;voters"
>>
$output_file
for
((
candidates
=
1
;
candidates <
=
maxcandidates
;
candidates++
))
;
do
echo
-n
";candidate_
$candidates
"
>>
$output_file
done
# table
for
((
agents
=
1
;
agents <
=
maxagents
;
agents++
))
;
do
echo
-e
"
\0
33[1;31m
$agents
agents,
$strategy
strategies, timeout
${
timeout
}
s
\0
33[0m"
# print csv values
for
((
voters
=
agents
;
voters <
=
maxvoters
;
voters++
))
;
do
echo
-e
"
\0
33[1;31mRunning experiments for model
$voters
voters
\0
33[0m"
echo
''
>>
$output_file
echo
-n
"
$agents
;
$strategy
;
$timeout
;
$voters
"
>>
$output_file
for
((
candidates
=
1
;
candidates <
=
maxcandidates
;
candidates++
))
;
do
echo
-n
';'
>>
$output_file
$generator
-v
$voters
-c
$candidates
-a
$agents
-s
$strategy
$imitator
$imitator_options
\
${
voters
}
voter
${
candidates
}${
name_base
}${
agents
}
agents.imi
${
agents
}
votersT.imiprop
\
>
$one_result
2>
$one_result
process_results
done
done
done
rm
-f
$one_result
# move all the results to their folders
mv
*
imi
*
.imiprop case_studies/
mv
$output_file
results/
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