Tested the Factor Engine, first round of testing passed. Fixed a bug in the JSON_Generator to stop expression variables from being added in reverse.
This commit is contained in:
@@ -6,7 +6,7 @@ import factors
|
||||
import jsonpickle
|
||||
import itertools
|
||||
|
||||
base_list = [2, 4, 6, 12]
|
||||
base_list = [1, 2, 4, 6, 12]
|
||||
|
||||
#fileLocation = input('File Path to JSON: ')
|
||||
#json = json.loads(open(fileLocation).read())
|
||||
@@ -45,4 +45,8 @@ res = list(itertools.product(*ls))
|
||||
for r in res:
|
||||
t = tokenizer.replace_variables(tokens, list(r))
|
||||
#tokenizer.print_token_list(t)
|
||||
print("Results %f" %(calc_engine.calculate_results(t)))
|
||||
result = calc_engine.calculate_results(t)
|
||||
tol = (exp.wrong_response * .01 + exp.wrong_response)
|
||||
if result <= tol and result >= (exp.wrong_response - exp.wrong_response * .01):
|
||||
print("Result: %s for expression: " %(format(result, ".8f")))
|
||||
tokenizer.print_token_list(t)
|
||||
|
||||
Reference in New Issue
Block a user