Skip to content

Commit

Permalink
Update generate-n script:
Browse files Browse the repository at this point in the history
- Added configurable product numbers
  • Loading branch information
JPugetGil committed Sep 4, 2024
1 parent 4bb997a commit 418f093
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions generate-n
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ then
fi
if [ $# == 0 ] || [ $1 == "-help" ]
then
echo "Generator options: ./generate-n <number of versions> ?<init number of products>"
echo "Generator options: ./generate-n <number of versions> ?<init number of products> ?<products step> ?<products variability>"
fi
# check that $1 is a integer
if ! [[ $1 =~ ^[0-9]+$ ]]
Expand All @@ -16,13 +16,16 @@ then
fi

number_of_versions=$1
products_number=${2:-1}
products_number=${2:-100}
products_step=${3:-1000}
products_variability=${4:-1}
echo "Generating $number_of_versions versions"
echo "Setting products to $products_number, products step to $products_step and variability to $products_variability"

# loop through the number of versions and call ./generate
for i in $(seq 1 $number_of_versions)
do
echo "Generating version $i"
echo "Generating $((products_number + i)) products"
./generate -s ttl -pc $((products_number + i)) -tc $((i)) -ppt $((i)) -fn "dataset-$i"
echo "Generating $((products_number + i * products_step)) products"
./generate -s ttl -pc $((products_number + i * products_step)) -tc $((i * products_step)) -ppt $((i * products_variability)) -fn "dataset-$i"
done

0 comments on commit 418f093

Please sign in to comment.