Updated the Expression object to include 'wrong_response' and wrote the code needed to start the finding mutations.
This commit is contained in:
@@ -1,28 +1,36 @@
|
||||
import token
|
||||
import ptoken as token
|
||||
import tokenizer
|
||||
#import expression
|
||||
import expression
|
||||
import calc_engine
|
||||
#import jsonpickle
|
||||
import factors
|
||||
import jsonpickle
|
||||
|
||||
base_list = [2, 4, 6, 12]
|
||||
|
||||
#fileLocation = input('File Path to JSON: ')
|
||||
#json = json.loads(open(fileLocation).read())
|
||||
|
||||
|
||||
#userInput = input('Enter your formula: ')
|
||||
tokens = tokenizer.get_tokens_from_expression_string("5000(2(2(1.08^10)-1)/0.08)")
|
||||
#with open("expression.json", "r") as f:
|
||||
# j = json.load(f)
|
||||
# exp = jsonpickle.decode(f.read())
|
||||
#exp = expression.Expression.from_json(json.loads(json.load(f)))
|
||||
# print(exp)
|
||||
results = calc_engine.calculate_results(tokens.copy())
|
||||
print(results)
|
||||
|
||||
#tokens = tokenizer.replace_variables(tokens, [23, 46, 89])
|
||||
#tokens = tokenizer.get_tokens_from_expression_string("5000(2(2(1.08^10)-1)/0.08)")
|
||||
with open("expression.json", "r") as f:
|
||||
#j = json.load(f)
|
||||
exp = jsonpickle.decode(f.read())
|
||||
print(exp)
|
||||
#results = calc_engine.calculate_results(tokens.copy())
|
||||
#print(results)
|
||||
|
||||
#for t in tokens:
|
||||
# print("%s (%s) " %(t.value, token.TokenType.get_token_type_name(t.type)), end = "")
|
||||
#print()
|
||||
|
||||
tokens = tokenizer.get_tokens_from_expression_string(exp.expression)
|
||||
|
||||
#def factors(factor_object, starting_point, variable_type)
|
||||
for v in exp.variables:
|
||||
factor = factors.Factor(v, base_list)
|
||||
|
||||
calce_answers(factor, exp.variables[v].starting_point, exp.variables[v].type, exp.wrong_response)
|
||||
|
||||
|
||||
|
||||
#def calc_answers(factor_object, starting_point, variable_type, wrong_response):
|
||||
|
||||
Reference in New Issue
Block a user