-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #307 from fandango-fuzzer/dev
Dev
- Loading branch information
Showing
13 changed files
with
110 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import random | ||
|
||
from evaluation.experiments.faker.faker_experiment import evaluate_faker | ||
from evaluation.experiments.hash.hash_experiment import evaluate_hash | ||
from evaluation.experiments.pixels.pixels_experiment import evaluate_pixels | ||
from evaluation.experiments.transactions.transactions_experiment import ( | ||
evaluate_transactions, | ||
) | ||
from evaluation.experiments.voltage.voltage_experiment import evaluate_voltage | ||
|
||
|
||
def run_experiments(): | ||
random_seed = 1 | ||
|
||
# Set the random seed | ||
random.seed(random_seed) | ||
|
||
try: | ||
evaluate_faker() | ||
evaluate_hash() | ||
evaluate_pixels() | ||
evaluate_transactions() | ||
evaluate_voltage() | ||
except Exception as e: | ||
raise e | ||
|
||
|
||
if __name__ == "__main__": | ||
run_experiments() |
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
evaluation/experiments/transactions/transactions_experiment.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from fandango.evolution.algorithm import Fandango | ||
from fandango.language.parse import parse | ||
|
||
|
||
def evaluate_transactions(): | ||
# Load the fandango file | ||
file = open("evaluation/experiments/transactions/transactions.fan", "r") | ||
grammar, constraints = parse(file, use_stdlib=False) | ||
|
||
fandango = Fandango(grammar, constraints) | ||
fandango.evolve() | ||
|
||
print(fandango.solution) | ||
|
||
|
||
if __name__ == "__main__": | ||
evaluate_transactions() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import unittest | ||
|
||
from evaluation.experiments.run_experiments import run_experiments | ||
|
||
|
||
class TestExperiments(unittest.TestCase): | ||
def test_run_experiments_one_second(self): | ||
try: | ||
run_experiments() | ||
except Exception as e: | ||
self.fail(f"run_evaluation raised an exception: {e}") | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters