-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimulate.py
More file actions
31 lines (24 loc) · 863 Bytes
/
simulate.py
File metadata and controls
31 lines (24 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# import os
# os.environ['WORKER_ID'] = 'solver-001'
# import logging
# import fastdb4py as fdb
# from python.snaking.src.snaking import snaking
# logging.basicConfig(level=logging.DEBUG)
# class Point(fdb.Feature):
# x: fdb.F64
# y: fdb.F64
# z: fdb.F64
# if __name__ == '__main__':
# snaking.final_step = 10
# with snaking.simulating(2):
# while snaking.keep_on:
# db_path = str(snaking.shared_path / 'points.fdb')
# db = fdb.ORM.load(db_path, from_file=True)
# ps = db[Point]['points']
# for p in ps:
# p.x += 1.0
# p.y += 1.0
# p.z += 1.0
# print(f'Point updated to ({ps[0].x}, {ps[0].y}, {ps[0].z})')
# db.save(db_path)
# snaking.current_step += 1