Package main
Class Settings
- java.lang.Object
-
- main.Settings
-
public class Settings extends Object
Central, static configuration of AuRUS: every knob the genetic search, the fitness function, the model counter and the external solvers read from.Fields are grouped by concern below, each documented with the command-line flag that sets it (see
Main), its default, and — where useful — a pointer to the class that reads it. This mirrors the "Configuration reference" tables in the project README; the two should be read together.All fields are public static and mutable by design:
Mainparses the command line once at start-up and writes directly into this class, and every other class reads from it for the rest of the run. There is deliberately no per-run instance — AuRUS runs one search per process.- Author:
- Matías Brizzio
- See Also:
Main,SpecificationGeneticAlgorithm,AutomataBasedModelCountingSpecificationFitness
-
-
Field Summary
Fields Modifier and Type Field Description static booleanallowAssumptionAdditionAllow the genetic operators to introduce brand-new assumptions rather than only modifying existing ones (flags-addA/-addAssumptions, defaultfalse).static booleanallowAssumptionRemovalAllow the genetic operators to drop assumptions entirely (flags-removeA/-removeAssumptions, defaultfalse).static booleanallowGuaranteeRemovalAllow the genetic operators to drop guarantees entirely (flags-removeG/-removeGuarantees, defaultfalse).static booleancheck_REALIZABILITYWhether realisability (via Strix, or strong satisfiability whencheck_STRONG_SATis set) is checked inside the fitness function itself, rather than only on final candidates (flag-onlySATsets this tofalse; defaulttrue).static booleancheck_STRONG_SATUse the strong-satisfiability (potential realisability) check instead of a full Strix realisability query inside the fitness (flag-strongSAT, defaultfalse) — cheaper, less precise.static intGA_CROSSOVER_RATEPercentage of chromosomes selected for crossover at each generation (flag-COR, default10).static intGA_EXECUTION_TIMEOUTOverall wall-clock budget for the genetic search, in seconds (flag-GATO, default0— no timeout).static intGA_GENE_MUTATION_RATEProbability (%) with which each gene (sub-formula) of a mutated chromosome is itself mutated (flag-geneMR, default0).static intGA_GENE_NUM_OF_MUTATIONSMaximum number of genes (sub-formulas) mutated per formula (flag-geneNUM, default0).static intGA_GENERATIONSNumber of generations the search runs for (flag-Gen, default10).static intGA_GUARANTEES_PREFERENCE_FACTORProbability (%,p) that a genetic operator (mutation or crossover) targets the guarantees rather than the assumptions; the assumptions are targeted with probability1-p(flag-GPR, default50).static intGA_MAX_NUM_INDIVIDUALSHard cap on the total number of individuals ever generated, across all generations (flag-Max, default: unbounded).static intGA_MUTATION_RATEProbability (%) with which the mutation operator is applied to each chromosome (flag-MR, default100— always).static intGA_POPULATION_SIZEPopulation size retained at each generation (flag-Pop, default100).static booleanGA_RANDOM_SELECTORUse a random selector instead of the best-selector for the next generation's parents (flag-GA_random_selector, defaultfalse).static intGA_REMOVE_ASSUMPTION_PROBProbability (in %) that the mutation operator drops an assumption conjunct entirely instead of rewriting one of its sub-formulas, whenallowAssumptionRemovalis enabled (flag-removeAProb, default5).static intGA_REMOVE_GUARANTEE_PROBProbability (in %) that the mutation operator drops a guarantee conjunct entirely instead of rewriting one of its sub-formulas, whenallowGuaranteeRemovalis enabled (flag-removeGProb, default0).static doubleGA_THRESHOLDMinimum fitness a candidate must reach to be collected as a solution during the search (flag-sol, default0.0— no threshold).static doubleLOST_MODELS_FACTORWeight of the lost-models direction of the semantic-similarity component (half of γ from-factors; default0.1).static intMC_BOUNDBoundkfor the bounded model-counting approach (flag-k, default10).static booleanMC_EXHAUSTIVEIntended to select an exact model counter instead of the automata/matrix approximation (flag-precisesets this tofalse; defaulttrue).static intMC_TIMEOUTTimeout, in seconds, for a single bounded model-counting query (flag-MCTO, default180).static booleanonly_inputs_in_assumptionsRestrict newly generated/transplanted assumption fragments to input variables only (flag-onlyInputsA, defaultfalse), preventing the environment from being "repaired" with constraints over outputs it cannot observe.static intPARSING_TIMEOUTTimeout, in seconds, for translating a formula into its automaton (default60).static RandomRANDOM_GENERATORShared random source for every stochastic decision in the search (selection coin flips, mutation targets, ...), seeded fromSEED.static intSAT_TIMEOUTTimeout, in seconds, for a single LTL satisfiability query (flag-SatTO, default30).static longSEEDThe seed backingRANDOM_GENERATOR.static StringSPECTRA_PATHWorking directory used when checking realisability of Spectra specifications (-use-spectra, default"docker-spectra/").static doubleSTATUS_FACTORWeight α of the realisability-status component in the fitness sum (flag-factors, first value; default0.7).static StringSTRIX_PATHWorking directory Strix (native or Docker) reads/writes its temporary TLSF files in; overridden to the output directory viasetStrixName(java.lang.String)when-outis given (default"docker/").static intSTRIX_TIMEOUTTimeout, in seconds, for a single Strix realisability query (flag-RTO, default20).static intSTRONG_SAT_TIMEOUTTimeout, in seconds, for a strong-satisfiability query (default180).static doubleSYNTACTIC_FACTORWeight β of the syntactic-similarity component in the fitness sum (flag-factors, second value; default0.1).static StringSYNTH_BINPath/name of the synthesiser binary to invoke forSYNTH_TOOL(flag-synth-bin).static StringSYNTH_TOOLWhich realisability/synthesis tool to invoke (flag-synth, default"strix").static booleanUSE_DOCKERRun Strix through the Docker image rather than the local install (flags-docker/-no-docker, defaultfalse— native).static booleanUSE_SPECTRATreat the input as a Spectra specification instead of TLSF (flag-use-spectra, defaultfalse).static doubleWON_MODELS_FACTORWeight of the won-models direction of the semantic-similarity component (the other half of γ; default0.1).
-
Constructor Summary
Constructors Constructor Description Settings()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleMAX_FITNESS()Theoretical maximum value the fitness function can return: the sum of all four component weights.static Stringprint_settings()Serialises every setting relevant to reproducing a run into a single line, printed at the start and end ofMainand written toout.txt.static voidsetFactors(double status_factor, double syntactic_factor, double semantic_factor)Sets the three top-level fitness weights (realisability status, syntactic similarity, semantic similarity), splitting the semantic weight evenly betweenLOST_MODELS_FACTORandWON_MODELS_FACTOR.static voidsetStrixName(String outname)RedirectsSTRIX_PATHto the given output directory (called when-outis supplied), so Strix's temporary files land next to the repairs rather than in the defaultdocker/directory.
-
-
-
Field Detail
-
USE_SPECTRA
public static boolean USE_SPECTRA
Treat the input as a Spectra specification instead of TLSF (flag-use-spectra, defaultfalse).
-
USE_DOCKER
public static boolean USE_DOCKER
Run Strix through the Docker image rather than the local install (flags-docker/-no-docker, defaultfalse— native). By default (no Docker, no Spectra), AuRUS callslib/new_strix/strixdirectly; seeStrixHelperfor the exact dispatch.
-
SYNTH_TOOL
public static String SYNTH_TOOL
Which realisability/synthesis tool to invoke (flag-synth, default"strix"). Currently supported:"strix"(the original path — native binary, or the Docker image whenUSE_DOCKERis set) and"ltlsynt"(part of the Spot library, installable without Docker via e.g.brew install spot(macOS) orconda install -c conda-forge spot(Linux/macOS, no root needed) — see spot.lre.epita.fr/install.html for the Debian/Ubuntu package repository. Read byStrixHelper.
-
SYNTH_BIN
public static String SYNTH_BIN
Path/name of the synthesiser binary to invoke forSYNTH_TOOL(flag-synth-bin). Empty means "use the tool's default":lib/new_strix/strixforstrix, orltlsyntresolved fromPATHforltlsynt.
-
SEED
public static long SEED
The seed backingRANDOM_GENERATOR. Auto-generated by default (so runs are non-deterministic out of the box) from the system clock, mixed with the 64-bit golden-ratio constant (0x9E3779B97F4A7C15) for good bit dispersion (the standard Fibonacci/golden-ratio hashing trick — avoids the low bits of consecutiveSystem.nanoTime()calls correlating between close-together runs). Always a concrete value — printed byprint_settings()in everyout.txt— so any past run can be reproduced after the fact by passing-seed=<that value>, even if it wasn't explicitly seeded when it originally ran. Explicitly setting it (flag-seed) makes AuRUS's own stochastic decisions (selection, mutation targets, crossover choices) reproducible given the same sequence of external solver verdicts — see the projectTODO.mdfor the current, honest state of end-to-end reproducibility (not yet complete: at least one additional source of run-to-run variance remains, independent of this seed).
-
RANDOM_GENERATOR
public static Random RANDOM_GENERATOR
-
GA_GENERATIONS
public static int GA_GENERATIONS
Number of generations the search runs for (flag-Gen, default10). Read bySpecificationGeneticAlgorithm.
-
GA_MAX_NUM_INDIVIDUALS
public static int GA_MAX_NUM_INDIVIDUALS
Hard cap on the total number of individuals ever generated, across all generations (flag-Max, default: unbounded).
-
GA_POPULATION_SIZE
public static int GA_POPULATION_SIZE
Population size retained at each generation (flag-Pop, default100).
-
GA_CROSSOVER_RATE
public static int GA_CROSSOVER_RATE
Percentage of chromosomes selected for crossover at each generation (flag-COR, default10).
-
GA_MUTATION_RATE
public static int GA_MUTATION_RATE
Probability (%) with which the mutation operator is applied to each chromosome (flag-MR, default100— always).
-
GA_GENE_MUTATION_RATE
public static int GA_GENE_MUTATION_RATE
Probability (%) with which each gene (sub-formula) of a mutated chromosome is itself mutated (flag-geneMR, default0). A value of0means the rate is derived as1/size_of(formula)— the rule used in the paper's experimental setup — rather than a fixed percentage; seeSpecificationMutator.
-
GA_GENE_NUM_OF_MUTATIONS
public static int GA_GENE_NUM_OF_MUTATIONS
Maximum number of genes (sub-formulas) mutated per formula (flag-geneNUM, default0). A value of0means no cap — up tosize_of(formula)mutations may be applied.
-
GA_EXECUTION_TIMEOUT
public static int GA_EXECUTION_TIMEOUT
Overall wall-clock budget for the genetic search, in seconds (flag-GATO, default0— no timeout).
-
GA_GUARANTEES_PREFERENCE_FACTOR
public static int GA_GUARANTEES_PREFERENCE_FACTOR
Probability (%,p) that a genetic operator (mutation or crossover) targets the guarantees rather than the assumptions; the assumptions are targeted with probability1-p(flag-GPR, default50).p = 0protects the guarantees entirely,p = 100protects the assumptions — useful when one side encodes fixed, non-negotiable constraints.
-
GA_RANDOM_SELECTOR
public static boolean GA_RANDOM_SELECTOR
Use a random selector instead of the best-selector for the next generation's parents (flag-GA_random_selector, defaultfalse). Read bycom.lagodiuk.ga.GeneticAlgorithm, the underlying GA engine.
-
only_inputs_in_assumptions
public static boolean only_inputs_in_assumptions
Restrict newly generated/transplanted assumption fragments to input variables only (flag-onlyInputsA, defaultfalse), preventing the environment from being "repaired" with constraints over outputs it cannot observe.
-
GA_THRESHOLD
public static double GA_THRESHOLD
Minimum fitness a candidate must reach to be collected as a solution during the search (flag-sol, default0.0— no threshold).
-
check_REALIZABILITY
public static boolean check_REALIZABILITY
Whether realisability (via Strix, or strong satisfiability whencheck_STRONG_SATis set) is checked inside the fitness function itself, rather than only on final candidates (flag-onlySATsets this tofalse; defaulttrue). SeeAutomataBasedModelCountingSpecificationFitness.compute_status(geneticalgorithm.SpecificationChromosome).
-
check_STRONG_SAT
public static boolean check_STRONG_SAT
Use the strong-satisfiability (potential realisability) check instead of a full Strix realisability query inside the fitness (flag-strongSAT, defaultfalse) — cheaper, less precise.
-
allowAssumptionAddition
public static boolean allowAssumptionAddition
Allow the genetic operators to introduce brand-new assumptions rather than only modifying existing ones (flags-addA/-addAssumptions, defaultfalse).
-
allowGuaranteeRemoval
public static boolean allowGuaranteeRemoval
Allow the genetic operators to drop guarantees entirely (flags-removeG/-removeGuarantees, defaultfalse).
-
allowAssumptionRemoval
public static boolean allowAssumptionRemoval
Allow the genetic operators to drop assumptions entirely (flags-removeA/-removeAssumptions, defaultfalse).
-
GA_REMOVE_ASSUMPTION_PROB
public static int GA_REMOVE_ASSUMPTION_PROB
Probability (in %) that the mutation operator drops an assumption conjunct entirely instead of rewriting one of its sub-formulas, whenallowAssumptionRemovalis enabled (flag-removeAProb, default5).
-
GA_REMOVE_GUARANTEE_PROB
public static int GA_REMOVE_GUARANTEE_PROB
Probability (in %) that the mutation operator drops a guarantee conjunct entirely instead of rewriting one of its sub-formulas, whenallowGuaranteeRemovalis enabled (flag-removeGProb, default0).
-
STATUS_FACTOR
public static double STATUS_FACTOR
Weight α of the realisability-status component in the fitness sum (flag-factors, first value; default0.7). Set together with the other three factors viasetFactors(double, double, double).
-
LOST_MODELS_FACTOR
public static double LOST_MODELS_FACTOR
Weight of the lost-models direction of the semantic-similarity component (half of γ from-factors; default0.1). Seedocs/FITNESS.md.
-
WON_MODELS_FACTOR
public static double WON_MODELS_FACTOR
Weight of the won-models direction of the semantic-similarity component (the other half of γ; default0.1). Seedocs/FITNESS.md.
-
SYNTACTIC_FACTOR
public static double SYNTACTIC_FACTOR
Weight β of the syntactic-similarity component in the fitness sum (flag-factors, second value; default0.1).
-
PARSING_TIMEOUT
public static int PARSING_TIMEOUT
Timeout, in seconds, for translating a formula into its automaton (default60). Read byEmersonLeiAutomatonBasedModelCounting.
-
MC_BOUND
public static int MC_BOUND
Boundkfor the bounded model-counting approach (flag-k, default10). Seedocs/FITNESS.mdfor what the bound controls.
-
MC_EXHAUSTIVE
public static boolean MC_EXHAUSTIVE
Intended to select an exact model counter instead of the automata/matrix approximation (flag-precisesets this tofalse; defaulttrue). Currently unused: no counting code path reads this field, so-precisehas no effect on the search — see the projectTODO.md.
-
MC_TIMEOUT
public static int MC_TIMEOUT
Timeout, in seconds, for a single bounded model-counting query (flag-MCTO, default180).
-
STRIX_TIMEOUT
public static int STRIX_TIMEOUT
Timeout, in seconds, for a single Strix realisability query (flag-RTO, default20).
-
STRIX_PATH
public static String STRIX_PATH
Working directory Strix (native or Docker) reads/writes its temporary TLSF files in; overridden to the output directory viasetStrixName(java.lang.String)when-outis given (default"docker/"). Read byTlsfUtils.
-
SPECTRA_PATH
public static String SPECTRA_PATH
Working directory used when checking realisability of Spectra specifications (-use-spectra, default"docker-spectra/"). Read byStrixHelper.
-
STRONG_SAT_TIMEOUT
public static int STRONG_SAT_TIMEOUT
Timeout, in seconds, for a strong-satisfiability query (default180).
-
SAT_TIMEOUT
public static int SAT_TIMEOUT
Timeout, in seconds, for a single LTL satisfiability query (flag-SatTO, default30).
-
-
Method Detail
-
MAX_FITNESS
public static double MAX_FITNESS()
Theoretical maximum value the fitness function can return: the sum of all four component weights. Used as a sanity ceiling — a computed fitness above this value indicates a configuration or arithmetic bug (seeAutomataBasedModelCountingSpecificationFitness.calculate(geneticalgorithm.SpecificationChromosome)).- Returns:
STATUS_FACTOR + LOST_MODELS_FACTOR + WON_MODELS_FACTOR + SYNTACTIC_FACTOR
-
setFactors
public static void setFactors(double status_factor, double syntactic_factor, double semantic_factor)Sets the three top-level fitness weights (realisability status, syntactic similarity, semantic similarity), splitting the semantic weight evenly betweenLOST_MODELS_FACTORandWON_MODELS_FACTOR. A negative argument leaves the corresponding setting(s) untouched, so callers can update a subset of the weights (this is how-factorsis applied, and howSpecificationGeneticAlgorithm.run(owl.ltl.tlsf.Tlsf)— which passes all three as-1.0— keeps the currently configured weights).- Parameters:
status_factor- new value forSTATUS_FACTOR, or negative to keep the current onesyntactic_factor- new value forSYNTACTIC_FACTOR, or negative to keep the current onesemantic_factor- new combined weight to split acrossLOST_MODELS_FACTORandWON_MODELS_FACTOR, or negative to keep the current ones
-
setStrixName
public static void setStrixName(String outname)
RedirectsSTRIX_PATHto the given output directory (called when-outis supplied), so Strix's temporary files land next to the repairs rather than in the defaultdocker/directory.- Parameters:
outname- the output directory (as passed to-out)
-
print_settings
public static String print_settings()
Serialises every setting relevant to reproducing a run into a single line, printed at the start and end ofMainand written toout.txt.- Returns:
- a human-readable, single-line summary of the current configuration
-
-