Skip to content

Commit

Permalink
feat:local qserver test
Browse files Browse the repository at this point in the history
  • Loading branch information
maffettone committed Dec 14, 2023
1 parent f4e15eb commit d2fb12f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pdf_agents/startup_scripts/mmm4-kmeans-local.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import numpy as np
import tiled.client.node
from bluesky_adaptive.server import register_variable, shutdown_decorator, startup_decorator
from bluesky_queueserver_api.zmq import REManagerAPI

from pdf_agents.sklearn import ActiveKmeansAgent

qserver = REManagerAPI(zmq_control_addr="tcp://xf28id1-srv1:60615", zmq_info_addr="tcp://xf28id1-srv1:60625")
agent = ActiveKmeansAgent(
bounds=np.array([(-32, 32), (-32, 32)]),
ask_on_tell=False,
report_on_tell=True,
k_clusters=4,
motor_names=["xstage", "ystage"],
qserver=qserver,
)


@startup_decorator
def startup():
agent.start()


@shutdown_decorator
def shutdown_agent():
return agent.stop()


register_variable("Tell Cache", agent, "tell_cache")
register_variable("Agent Name", agent, "instance_name")

0 comments on commit d2fb12f

Please sign in to comment.