-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4e15eb
commit d2fb12f
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |