Skip to content

Commit

Permalink
Change MPC example to create anim dir and correct ticks bug. Quick fi…
Browse files Browse the repository at this point in the history
…x for patch 0.2.1.
  • Loading branch information
ThibaultMarzullo committed Feb 20, 2022
1 parent 8f305ef commit 375b91c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/python/MPC-spawnrefsmalloffice-DRevent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@
simulator, actb_client, t_offset = template_simulator(model)#, metamodel='spawnrefsmalloffice')

results_path = 'results/som3_mpc_boptest'

anim_path = 'anim/'
# delete the contents of the results path
if os.path.exists(results_path):
shutil.rmtree(results_path)
if os.path.exists(anim_path):
shutil.rmtree(anim_path)
os.makedirs(results_path, exist_ok=True)
os.makedirs(anim_path, exist_ok=True)


historian = Historian(time_step=5)

Expand Down Expand Up @@ -69,7 +73,7 @@
mpc_plot = do_mpc.graphics.Graphics(mpc.data)
sim_plot = do_mpc.graphics.Graphics(simulator.data)

xticks = range(0, int(mp.length), int(6 * 3600))
xticks = range(0, int(mp.length) + 6 * 3600, int(6 * 3600))
xlabels = range(0, int(mp.length/3600) + 6, 6)

axis = 0
Expand Down

0 comments on commit 375b91c

Please sign in to comment.