Skip to content

Commit

Permalink
Fixed v(+1) bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
albop committed Sep 23, 2016
1 parent 5f6d4c1 commit d371180
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions dolo/compiler/symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ def eval_scalar(tree):
elif isinstance(tree, ast.UnaryOp):
if isinstance(tree.op, ast.USub):
return -tree.operand.n
if isinstance(tree.op, ast.UAdd):
return tree.operand.n
else:
raise Exception("Don't know how to do that.")
except:
Expand Down
6 changes: 3 additions & 3 deletions dolo/tests/test_rbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def test_rbc_model():
pol = evaluate_policy(model, dr, verbose=True)
polg = evaluate_policy(model, drg, verbose=True)

sim = simulate(model, dr, n_exp=0) # irf
sim = simulate(model, dr, n_exp=2) # stochastic simulations (2 draws)
# extract first simulation
sim = simulate(model, dr, n_exp=0) # irf
sim = simulate(model, dr, n_exp=2) # stochastic simulations (2 draws)
# extract first simulation
assert(len(sim[0]['k'])==40)


Expand Down

0 comments on commit d371180

Please sign in to comment.