parseSimFileLine :: String -> Either String SimCommand
parseSimFileLine s
- | "#" `isPrefixOf` s = Right (CommandComment s)
+ | "#" `isPrefixOf` s || "--" `isPrefixOf` s =
+ Right (CommandComment s)
| all isSpace s = Right (CommandBlank)
| otherwise = parseSimCommand (words s)
This text file is used to configure the simulation and also to report on
the results of the simulation. Each line takes the form of a command
-followed by parameters to the command. Lines starting with "#" are comments.
+followed by parameters to the command. Lines starting with "#" or "--"
+are comments.
Here is an example sim file:
-# size balanced preferred content sim
+-- size balanced preferred content sim
seed -4592890916829221843
init foo
init bar
-# This is a simulation of random preferred content expressions.
-# git-annex sim run this in a loop to explore if an expression can fail to
-# stabilize
+-- This is a simulation of random preferred content expressions.
+-- git-annex sim run this in a loop to explore if an expression can fail to
+-- stabilize
init foo
init bar
connect foo <-> bar
addmulti 10 .y 100.0kB 10.0MB foo
randomwanted bar largerthan=1MB include=*.x anything present
randomwanted foo largerthan=1MB include=*.x anything present
-# 40 is the maximum possible steps, in case bar wants to get all 20 files,
-# and foo wants to drop them all
+-- 40 is the maximum possible steps, in case bar wants to get all 20 files,
+-- and foo wants to drop them all
stepstable 40
-# Size balanced preferred content sim with multiple repositories sending
-# concurrently to the same repositories, in a cluster.
-#
-# This demonstrates that size balanced preferred content does not get out
-# of balance when used with cluster nodes.
+-- Size balanced preferred content sim with multiple repositories sending
+-- concurrently to the same repositories, in a cluster.
+--
+-- This demonstrates that size balanced preferred content does not get out
+-- of balance when used with cluster nodes.
init foo
init bar
init node1
-# Size balanced preferred content sim with multiple repositories sending
-# concurrently to the same repositories, without communication.
-#
-# This demonstrates how size balanced preferred content can get out of
-# balance in this situation. Since there is no random seed, each
-# git-annex sim start of this file will display a different result.
+-- Size balanced preferred content sim with multiple repositories sending
+-- concurrently to the same repositories, without communication.
+--
+-- This demonstrates how size balanced preferred content can get out of
+-- balance in this situation. Since there is no random seed, each
+-- git-annex sim start of this file will display a different result.
init foo
init fii
init fum
action foo gitpull fii
action foo gitpull fum
visit foo git-annex maxsize
-#rebalance on
-#step 100
-#visit foo echo "after rebalance:"; git-annex maxsize
+--rebalance on
+--step 100
+--visit foo echo "after rebalance:"; git-annex maxsize