diff --git a/404.html b/404.html index 3e1bae1..144107a 100644 --- a/404.html +++ b/404.html @@ -10,7 +10,7 @@ - + diff --git a/assets/images/const-5bcaffaebb43bd3cfbb4aef21f15c72a.png b/assets/images/const-5bcaffaebb43bd3cfbb4aef21f15c72a.png new file mode 100644 index 0000000..08f6dde Binary files /dev/null and b/assets/images/const-5bcaffaebb43bd3cfbb4aef21f15c72a.png differ diff --git a/assets/images/ctrl_misc-045bc1ef53442a1bfe2b1b6edaf9e276.png b/assets/images/ctrl_misc-045bc1ef53442a1bfe2b1b6edaf9e276.png new file mode 100644 index 0000000..06921ba Binary files /dev/null and b/assets/images/ctrl_misc-045bc1ef53442a1bfe2b1b6edaf9e276.png differ diff --git a/assets/images/delete_run-c7585c42abc4d891d72c824cb261da5a.png b/assets/images/delete_run-c7585c42abc4d891d72c824cb261da5a.png new file mode 100644 index 0000000..64ed4e8 Binary files /dev/null and b/assets/images/delete_run-c7585c42abc4d891d72c824cb261da5a.png differ diff --git a/assets/images/jump_to_opt-f6d0f7a9cde9986021152fb9d6499b0e.png b/assets/images/jump_to_opt-f6d0f7a9cde9986021152fb9d6499b0e.png new file mode 100644 index 0000000..e03b8ec Binary files /dev/null and b/assets/images/jump_to_opt-f6d0f7a9cde9986021152fb9d6499b0e.png differ diff --git a/assets/images/obj-ef68266ca3f6f3b8ccf096262469853c.png b/assets/images/obj-ef68266ca3f6f3b8ccf096262469853c.png new file mode 100644 index 0000000..f89f4fc Binary files /dev/null and b/assets/images/obj-ef68266ca3f6f3b8ccf096262469853c.png differ diff --git a/assets/images/set_env-2eca47029e68a10e40289efebf20a61e.png b/assets/images/set_env-2eca47029e68a10e40289efebf20a61e.png new file mode 100644 index 0000000..34ada71 Binary files /dev/null and b/assets/images/set_env-2eca47029e68a10e40289efebf20a61e.png differ diff --git a/assets/images/set_gen-1d96ad5a85afdfc4777213499c57fe69.png b/assets/images/set_gen-1d96ad5a85afdfc4777213499c57fe69.png new file mode 100644 index 0000000..6838bb7 Binary files /dev/null and b/assets/images/set_gen-1d96ad5a85afdfc4777213499c57fe69.png differ diff --git a/assets/images/set_meta-ebb3a23dae9a4d4f4d60904eaa3277a1.png b/assets/images/set_meta-ebb3a23dae9a4d4f4d60904eaa3277a1.png new file mode 100644 index 0000000..2a7e8ea Binary files /dev/null and b/assets/images/set_meta-ebb3a23dae9a4d4f4d60904eaa3277a1.png differ diff --git a/assets/images/tc-9b337fefa8578fbb81bd8e02eb9eb901.png b/assets/images/tc-9b337fefa8578fbb81bd8e02eb9eb901.png new file mode 100644 index 0000000..cc10238 Binary files /dev/null and b/assets/images/tc-9b337fefa8578fbb81bd8e02eb9eb901.png differ diff --git a/assets/images/var-d822f4429c98425f996d18ab63869003.png b/assets/images/var-d822f4429c98425f996d18ab63869003.png new file mode 100644 index 0000000..8304dec Binary files /dev/null and b/assets/images/var-d822f4429c98425f996d18ab63869003.png differ diff --git a/assets/images/vis_options-43f4587e48e7e864f7c452507765e07a.png b/assets/images/vis_options-43f4587e48e7e864f7c452507765e07a.png new file mode 100644 index 0000000..62d2d16 Binary files /dev/null and b/assets/images/vis_options-43f4587e48e7e864f7c452507765e07a.png differ diff --git a/assets/js/5e2ad779.4c87342d.js b/assets/js/5e2ad779.4c87342d.js deleted file mode 100644 index f1acec5..0000000 --- a/assets/js/5e2ad779.4c87342d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbadger_home=self.webpackChunkbadger_home||[]).push([[3061],{5787:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>c,frontMatter:()=>r,metadata:()=>a,toc:()=>h});var n=i(5893),o=i(1151);const r={sidebar_position:3},s="GUI Usage",a={id:"guides/gui-usage",title:"GUI Usage",description:"Once you launch Badger in GUI mode, you'll have various Badger features to explore. You can search through this page to get to the guide on any specify GUI feature, or if you believe a guide is missing for the topic you are interested in, please consider raising an issue here or shooting us an email, many thanks :)",source:"@site/docs/guides/gui-usage.md",sourceDirName:"guides",slug:"/guides/gui-usage",permalink:"/Badger/docs/next/guides/gui-usage",draft:!1,unlisted:!1,editUrl:"https://github.com/SLAC-ML/Badger-Home/edit/master/docs/guides/gui-usage.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"CLI Usage",permalink:"/Badger/docs/next/guides/cli-usage"},next:{title:"Create a plugin",permalink:"/Badger/docs/next/guides/create-a-plugin"}},l={},h=[{value:"Home page",id:"home-page",level:2},{value:"Create a new routine",id:"create-a-new-routine",level:3},{value:"Select/deselect a routine",id:"selectdeselect-a-routine",level:3},{value:"Delete a routine",id:"delete-a-routine",level:3},{value:"Filter routines",id:"filter-routines",level:3},{value:"Browse the historical runs",id:"browse-the-historical-runs",level:3},{value:"Configure Badger settings",id:"configure-badger-settings",level:3},{value:"Export/import routines",id:"exportimport-routines",level:3},{value:"Routine monitor",id:"routine-monitor",level:2},{value:"Control an optimization run",id:"control-an-optimization-run",level:3},{value:"Reset the environment",id:"reset-the-environment",level:3},{value:"Inspect the solutions in a run",id:"inspect-the-solutions-in-a-run",level:3},{value:"Jump to the optimal solution",id:"jump-to-the-optimal-solution",level:3},{value:"Dial in the selected solution",id:"dial-in-the-selected-solution",level:3},{value:"Change the horizontal axis",id:"change-the-horizontal-axis",level:3},{value:"Normalize the variables for better visualization",id:"normalize-the-variables-for-better-visualization",level:3},{value:"Delete a run",id:"delete-a-run",level:3},{value:"Send record to logbook",id:"send-record-to-logbook",level:3},{value:"Use data analysis/visualization extensions",id:"use-data-analysisvisualization-extensions",level:3},{value:"Routine editor",id:"routine-editor",level:2},{value:"Set the metadata",id:"set-the-metadata",level:3},{value:"Select and configure the generator",id:"select-and-configure-the-generator",level:3},{value:"Select and configure the environment",id:"select-and-configure-the-environment",level:3},{value:"Configure the VOCS",id:"configure-the-vocs",level:3}];function d(e){const t={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",img:"img",p:"p",strong:"strong",...(0,o.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"gui-usage",children:"GUI Usage"}),"\n",(0,n.jsxs)(t.p,{children:["Once you launch Badger in GUI mode, you'll have various Badger features to explore. You can search through this page to get to the guide on any specify GUI feature, or if you believe a guide is missing for the topic you are interested in, please consider ",(0,n.jsx)(t.a,{href:"https://github.com/slaclab/Badger/issues/new",children:"raising an issue here"})," or ",(0,n.jsx)(t.a,{href:"mailto:zhezhang@slac.stanford.edu",children:"shooting us an email"}),", many thanks :)"]}),"\n",(0,n.jsx)(t.h2,{id:"home-page",children:"Home page"}),"\n",(0,n.jsx)(t.h3,{id:"create-a-new-routine",children:"Create a new routine"}),"\n",(0,n.jsxs)(t.p,{children:["On Badger home page, click the ",(0,n.jsx)(t.em,{children:"Plus"})," button (highlighted in the screenshot below):"]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Create new routine",src:i(4245).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsx)(t.p,{children:"You'll land on the routine editor page:"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Routine editor",src:i(5302).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsx)(t.p,{children:"where you can select the generator to use, the environment to optimize on, and configure the VOCS."}),"\n",(0,n.jsx)(t.h3,{id:"selectdeselect-a-routine",children:"Select/deselect a routine"}),"\n",(0,n.jsx)(t.p,{children:"Hover one item in the routine list (highlighted below) and click it will select the specific routine:"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Hover on routine",src:i(351).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsxs)(t.p,{children:["Once selected, the content in the ",(0,n.jsx)(t.a,{href:"#browse-the-historical-runs",children:"history browser"})," (on top of the run monitor) will change to show the runs corresponding to the selected routine only."]}),"\n",(0,n.jsx)(t.p,{children:"Click the selected routine again to deselect it. If no routine is selected, the history browser will show all the runs for all the routines."}),"\n",(0,n.jsx)(t.h3,{id:"delete-a-routine",children:"Delete a routine"}),"\n",(0,n.jsxs)(t.p,{children:["Hover the ",(0,n.jsx)(t.em,{children:"Delete"})," button (the one with the trash can icon) on the routine you'd like to delete will highlight it in red, click the button and confirm on the confirmation dialog will delete the routine."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Delete a routine",src:i(6169).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsxs)(t.p,{children:["Note that deleting a routine will ",(0,n.jsx)(t.strong,{children:"NOT"})," automatically delete all the runs associate with it. This behavior is intended to give users a chance to recover it if regretted later. Of course, if all the associated runs have already been deleted, then it will not be possible to recover the routine -- nevertheless you can ",(0,n.jsx)(t.a,{href:"#create-a-new-routine",children:"recreate it"}),", creating a routine is not that hard after all."]}),"\n",(0,n.jsx)(t.h3,{id:"filter-routines",children:"Filter routines"}),"\n",(0,n.jsx)(t.p,{children:"You can use the search bar to filter the routines. Badger will try to match the routine names with the text you put in the search bar. Currently we don't support RegEx, but we plan to add the support in the future releases, along with the ability to search other metadata, such as descriptions."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Filter routines",src:i(2441).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsx)(t.h3,{id:"browse-the-historical-runs",children:"Browse the historical runs"}),"\n",(0,n.jsxs)(t.p,{children:["You can browse the historical runs in Badger by clicking the ",(0,n.jsx)(t.em,{children:"Next"}),"/",(0,n.jsx)(t.em,{children:"Previous"})," buttons in the history browser:"]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"History browser",src:i(193).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsx)(t.p,{children:"or simply click on the combobox that shows the current run name, to trigger a dropdown menu that lists all the matched runs (categorized and sorted by run date and time). Clicking on a run in the menu will show the run data in the run monitor below."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"History dropdown",src:i(937).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsx)(t.p,{children:"Note that the routine editor content will also be refreshed according to routine of the selected run."}),"\n",(0,n.jsx)(t.h3,{id:"configure-badger-settings",children:"Configure Badger settings"}),"\n",(0,n.jsxs)(t.p,{children:["Click the ",(0,n.jsx)(t.em,{children:"Settings"})," button (with the little gear icon) on the bottom right of the Badger GUI will bring up the Badger settings dialog, where you can configure Badger as needed:"]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Configure Badger",src:i(2124).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsxs)(t.p,{children:["As a side note, the routine name for the current run shown in the run monitor is displayed besides the ",(0,n.jsx)(t.em,{children:"Settings"})," button."]}),"\n",(0,n.jsx)(t.h3,{id:"exportimport-routines",children:"Export/import routines"}),"\n",(0,n.jsxs)(t.p,{children:["Click the ",(0,n.jsx)(t.em,{children:"Export"}),"/",(0,n.jsx)(t.em,{children:"Import"})," button below the routine list will let you export the ",(0,n.jsxs)(t.a,{href:"#filter-routines",children:[(0,n.jsx)(t.strong,{children:"FILTERED"})," routines"]})," as a ",(0,n.jsx)(t.code,{children:".db"})," file or import the routines in a ",(0,n.jsx)(t.code,{children:".db"})," file."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Export/import routines",src:i(1144).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsx)(t.h2,{id:"routine-monitor",children:"Routine monitor"}),"\n",(0,n.jsx)(t.h3,{id:"control-an-optimization-run",children:"Control an optimization run"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Control a run",src:i(7202).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsx)(t.h3,{id:"reset-the-environment",children:"Reset the environment"}),"\n",(0,n.jsxs)(t.p,{children:["You can reset the environment to initial states after a run by clicking the ",(0,n.jsx)(t.em,{children:"Reset"})," button. Note that you can only reset the environment that you just run, and you cannot reset the environment in the middle of a run. To achieve the latter, ",(0,n.jsx)(t.a,{href:"#control-an-optimization-run",children:"terminate the run"})," first and then reset."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Reset the env",src:i(7202).Z+"",width:"2784",height:"1720"})}),"\n",(0,n.jsx)(t.h3,{id:"inspect-the-solutions-in-a-run",children:"Inspect the solutions in a run"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{alt:"Inspect solutions",src:i(849).Z+"",width:"2784",height:"2078"})}),"\n",(0,n.jsx)(t.h3,{id:"jump-to-the-optimal-solution",children:"Jump to the optimal solution"}),"\n",(0,n.jsx)(t.h3,{id:"dial-in-the-selected-solution",children:"Dial in the selected solution"}),"\n",(0,n.jsx)(t.h3,{id:"change-the-horizontal-axis",children:"Change the horizontal axis"}),"\n",(0,n.jsxs)(t.p,{children:["You can show the run on iteration-based x-axis or time-based x-axis. Simply select the desired x-axis type in the dropdown menu of the ",(0,n.jsx)(t.em,{children:"X Axis Plot Type"})," selector will do. You can switch the x-axis types anytime, in the middle of a run of not."]}),"\n",(0,n.jsx)(t.h3,{id:"normalize-the-variables-for-better-visualization",children:"Normalize the variables for better visualization"}),"\n",(0,n.jsxs)(t.p,{children:["You can show the run on iteration-based x-axis or time-based x-axis. Simply select the desired x-axis type in the dropdown menu of the ",(0,n.jsx)(t.em,{children:"X Axis Plot Type"})," selector will do. You can switch the x-axis types anytime, in the middle of a run of not."]}),"\n",(0,n.jsx)(t.h3,{id:"delete-a-run",children:"Delete a run"}),"\n",(0,n.jsx)(t.h3,{id:"send-record-to-logbook",children:"Send record to logbook"}),"\n",(0,n.jsx)(t.h3,{id:"use-data-analysisvisualization-extensions",children:"Use data analysis/visualization extensions"}),"\n",(0,n.jsx)(t.h2,{id:"routine-editor",children:"Routine editor"}),"\n",(0,n.jsx)(t.h3,{id:"set-the-metadata",children:"Set the metadata"}),"\n",(0,n.jsx)(t.h3,{id:"select-and-configure-the-generator",children:"Select and configure the generator"}),"\n",(0,n.jsx)(t.h3,{id:"select-and-configure-the-environment",children:"Select and configure the environment"}),"\n",(0,n.jsx)(t.h3,{id:"configure-the-vocs",children:"Configure the VOCS"})]})}function c(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},7202:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/control-6093247235285dea876d9f78db347659.png"},4245:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/create_new_routine-56ddde3bb0995b5fd4737de09fccedc2.png"},6169:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/delete_routine-f4138a20ffb79f2d80f4017ac4ce429c.png"},1144:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/export_import_routines-73fe50b02fb2177b5ab579d15e180de9.png"},2441:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/filter_routines-79766aa9181762ebed1e2198ce343f1c.png"},193:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/history_browser-9fcbac20951a9465229be19606ccb3c3.png"},937:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/history_dropdown-47eebf0e6413f150ccfe28e222bf3805.png"},351:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/hover_on_routine-c36631e9d274acab130661e66217f631.png"},849:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/inspect_sol-882235e407931101b2ac34456221c4f2.png"},5302:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/routine_editor-cb93cadbd434db75fb4244dd81e7f034.png"},2124:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/settings-6f10cc35e9b79d337b02bdddae093c78.png"},1151:(e,t,i)=>{i.d(t,{Z:()=>a,a:()=>s});var n=i(7294);const o={},r=n.createContext(o);function s(e){const t=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5e2ad779.ec0e2f8b.js b/assets/js/5e2ad779.ec0e2f8b.js new file mode 100644 index 0000000..f34514a --- /dev/null +++ b/assets/js/5e2ad779.ec0e2f8b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkbadger_home=self.webpackChunkbadger_home||[]).push([[3061],{5787:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>r,metadata:()=>a,toc:()=>h});var i=n(5893),o=n(1151);const r={sidebar_position:3},s="GUI Usage",a={id:"guides/gui-usage",title:"GUI Usage",description:"Once you launch Badger in GUI mode, you'll have various Badger features to explore. You can search through this page to get to the guide on any specify GUI feature, or if you believe a guide is missing for the topic you are interested in, please consider raising an issue here or shooting us an email, many thanks :)",source:"@site/docs/guides/gui-usage.md",sourceDirName:"guides",slug:"/guides/gui-usage",permalink:"/Badger/docs/next/guides/gui-usage",draft:!1,unlisted:!1,editUrl:"https://github.com/SLAC-ML/Badger-Home/edit/master/docs/guides/gui-usage.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"CLI Usage",permalink:"/Badger/docs/next/guides/cli-usage"},next:{title:"Create a plugin",permalink:"/Badger/docs/next/guides/create-a-plugin"}},l={},h=[{value:"Home page",id:"home-page",level:2},{value:"Create a new routine",id:"create-a-new-routine",level:3},{value:"Select/deselect a routine",id:"selectdeselect-a-routine",level:3},{value:"Edit a routine",id:"edit-a-routine",level:3},{value:"Delete a routine",id:"delete-a-routine",level:3},{value:"Filter routines",id:"filter-routines",level:3},{value:"Browse the historical runs",id:"browse-the-historical-runs",level:3},{value:"Configure Badger settings",id:"configure-badger-settings",level:3},{value:"Export/import routines",id:"exportimport-routines",level:3},{value:"Run monitor",id:"run-monitor",level:2},{value:"Control an optimization run",id:"control-an-optimization-run",level:3},{value:"Set termination condition",id:"set-termination-condition",level:3},{value:"Reset the environment",id:"reset-the-environment",level:3},{value:"Inspect the solutions in a run",id:"inspect-the-solutions-in-a-run",level:3},{value:"Jump to the optimal solution",id:"jump-to-the-optimal-solution",level:3},{value:"Dial in the selected solution",id:"dial-in-the-selected-solution",level:3},{value:"Change the horizontal axis",id:"change-the-horizontal-axis",level:3},{value:"Normalize the variables for better visualization",id:"normalize-the-variables-for-better-visualization",level:3},{value:"Delete a run",id:"delete-a-run",level:3},{value:"Send record to logbook",id:"send-record-to-logbook",level:3},{value:"Use data analysis/visualization extensions",id:"use-data-analysisvisualization-extensions",level:3},{value:"Routine editor",id:"routine-editor",level:2},{value:"Set the metadata",id:"set-the-metadata",level:3},{value:"Select and configure the generator",id:"select-and-configure-the-generator",level:3},{value:"Select and configure the environment",id:"select-and-configure-the-environment",level:3},{value:"Configure the VOCS",id:"configure-the-vocs",level:3}];function c(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",section:"section",strong:"strong",sup:"sup",ul:"ul",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"gui-usage",children:"GUI Usage"}),"\n",(0,i.jsxs)(t.p,{children:["Once you launch Badger in GUI mode, you'll have various Badger features to explore. You can search through this page to get to the guide on any specify GUI feature, or if you believe a guide is missing for the topic you are interested in, please consider ",(0,i.jsx)(t.a,{href:"https://github.com/slaclab/Badger/issues/new",children:"raising an issue here"})," or ",(0,i.jsx)(t.a,{href:"mailto:zhezhang@slac.stanford.edu",children:"shooting us an email"}),", many thanks :)"]}),"\n",(0,i.jsx)(t.h2,{id:"home-page",children:"Home page"}),"\n",(0,i.jsx)(t.h3,{id:"create-a-new-routine",children:"Create a new routine"}),"\n",(0,i.jsxs)(t.p,{children:["On Badger home page, click the ",(0,i.jsx)(t.em,{children:"Plus"})," button (highlighted in the screenshot below):"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Create new routine",src:n(4245).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.p,{children:"You'll land on the routine editor page:"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Routine editor",src:n(5302).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.p,{children:"where you can select the generator to use, the environment to optimize on, and configure the VOCS."}),"\n",(0,i.jsx)(t.h3,{id:"selectdeselect-a-routine",children:"Select/deselect a routine"}),"\n",(0,i.jsx)(t.p,{children:"Hover one item in the routine list (highlighted below) and click it will select the specific routine:"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Hover on routine",src:n(351).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsxs)(t.p,{children:["Once selected, the content in the ",(0,i.jsx)(t.a,{href:"#browse-the-historical-runs",children:"history browser"})," (on top of the run monitor) will change to show the runs corresponding to the selected routine only."]}),"\n",(0,i.jsx)(t.p,{children:"Click the selected routine again to deselect it. If no routine is selected, the history browser will show all the runs for all the routines."}),"\n",(0,i.jsx)(t.h3,{id:"edit-a-routine",children:"Edit a routine"}),"\n",(0,i.jsxs)(t.p,{children:["After ",(0,i.jsx)(t.a,{href:"#selectdeselect-a-routine",children:"select a routine"}),", click the ",(0,i.jsx)(t.em,{children:"Routine Editor"})," tab on top of the ",(0,i.jsx)(t.a,{href:"#run-monitor",children:"run monitor"}),", you'll be able to edit the routine and save the changes."]}),"\n",(0,i.jsxs)(t.admonition,{type:"tip",children:[(0,i.jsx)(t.p,{children:"One important/counterintuitive thing to keep in mind though, is that in Badger, if you have at least one run associates with the routine, you cannot edit and save the changed under the same routine name, you'll have to give the edited routine a new name. This behavior is to guarantee that each run can be mapped to the correct routine by the time it was run."}),(0,i.jsx)(t.p,{children:"Of course, if there are no runs associate with the routine, you can edit and rename it just fine."})]}),"\n",(0,i.jsx)(t.h3,{id:"delete-a-routine",children:"Delete a routine"}),"\n",(0,i.jsxs)(t.p,{children:["Hover the ",(0,i.jsx)(t.em,{children:"Delete"})," button (the one with the trash can icon) on the routine you'd like to delete will highlight it in red, click the button and confirm on the confirmation dialog will delete the routine."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Delete a routine",src:n(6169).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsxs)(t.p,{children:["Note that deleting a routine will ",(0,i.jsx)(t.strong,{children:"NOT"})," automatically delete all the runs associate with it. This behavior is intended to give users a chance to recover it if regretted later. Of course, if all the associated runs have already been deleted, then it will not be possible to recover the routine -- nevertheless you can ",(0,i.jsx)(t.a,{href:"#create-a-new-routine",children:"recreate it"}),", creating a routine is not that hard after all."]}),"\n",(0,i.jsx)(t.h3,{id:"filter-routines",children:"Filter routines"}),"\n",(0,i.jsx)(t.p,{children:"You can use the search bar to filter the routines. Badger will try to match the routine names with the text you put in the search bar. Currently we don't support RegEx, but we plan to add the support in the future releases, along with the ability to search other metadata, such as descriptions."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Filter routines",src:n(2441).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.h3,{id:"browse-the-historical-runs",children:"Browse the historical runs"}),"\n",(0,i.jsxs)(t.p,{children:["You can browse the historical runs in Badger by clicking the ",(0,i.jsx)(t.em,{children:"Next"}),"/",(0,i.jsx)(t.em,{children:"Previous"})," buttons in the history browser:"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"History browser",src:n(193).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.p,{children:"or simply click on the combobox that shows the current run name, to trigger a dropdown menu that lists all the matched runs (categorized and sorted by run date and time). Clicking on a run in the menu will show the run data in the run monitor below."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"History dropdown",src:n(937).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.p,{children:"Note that the routine editor content will also be refreshed according to routine of the selected run."}),"\n",(0,i.jsx)(t.h3,{id:"configure-badger-settings",children:"Configure Badger settings"}),"\n",(0,i.jsxs)(t.p,{children:["Click the ",(0,i.jsx)(t.em,{children:"Settings"})," button (with the little gear icon) on the bottom right of the Badger GUI will bring up the Badger settings dialog, where you can configure Badger as needed:"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Configure Badger",src:n(2124).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsxs)(t.p,{children:["As a side note, the routine name for the current run shown in the run monitor is displayed besides the ",(0,i.jsx)(t.em,{children:"Settings"})," button."]}),"\n",(0,i.jsx)(t.h3,{id:"exportimport-routines",children:"Export/import routines"}),"\n",(0,i.jsxs)(t.p,{children:["Click the ",(0,i.jsx)(t.em,{children:"Export"}),"/",(0,i.jsx)(t.em,{children:"Import"})," button below the routine list will let you export the ",(0,i.jsxs)(t.a,{href:"#filter-routines",children:[(0,i.jsx)(t.strong,{children:"FILTERED"})," routines"]})," as a ",(0,i.jsx)(t.code,{children:".db"})," file or import the routines in a ",(0,i.jsx)(t.code,{children:".db"})," file."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Export/import routines",src:n(1144).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.h2,{id:"run-monitor",children:"Run monitor"}),"\n",(0,i.jsx)(t.h3,{id:"control-an-optimization-run",children:"Control an optimization run"}),"\n",(0,i.jsx)(t.p,{children:"Start an optimization run by either:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"#selectdeselect-a-routine",children:"Select a routine"})," and click the green ",(0,i.jsx)(t.em,{children:"Run/Stop"})," button (with the play icon), or"]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"#browse-the-historical-runs",children:"Browse the historical runs"})," and select the one you'd like to rerun, then click the ",(0,i.jsx)(t.em,{children:"Run/Stop"})," button"]}),"\n"]}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsxs)(t.p,{children:["Note that for the second approach, Badger simply uses the routine that drove the selected historical run to run the new round of optimization. It does ",(0,i.jsx)(t.strong,{children:"NOT"})," continue the old run. That being said, the continue old run feature is planned for future releases of Badger."]})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Control a run",src:n(7202).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsxs)(t.p,{children:["To pause the run, click the ",(0,i.jsx)(t.em,{children:"Pause/Resume"})," button to the right of the ",(0,i.jsx)(t.em,{children:"Run/Stop"})," button. To resume a paused run, click the ",(0,i.jsx)(t.em,{children:"Pause/Resume"})," button again."]}),"\n",(0,i.jsxs)(t.p,{children:["Click the ",(0,i.jsx)(t.em,{children:"Run/Stop"})," button again (turned red once the run started) to stop the run."]}),"\n",(0,i.jsx)(t.h3,{id:"set-termination-condition",children:"Set termination condition"}),"\n",(0,i.jsxs)(t.p,{children:["Click the small dropdown arrow on the ",(0,i.jsx)(t.em,{children:"Run/Stop"})," button to open the run menu, select ",(0,i.jsx)(t.em,{children:"Run until"}),", then configure the termination condition and run the optimization. The run will be terminated once the terminaton condition is met."]}),"\n",(0,i.jsx)(t.p,{children:"Currently Badger supports two types of termination conditions:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Terminate when maximum evaluation reached, or"}),"\n",(0,i.jsx)(t.li,{children:"Terminate when maximum running time exceeded"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"The convergence-based termination condition will be added soon."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Set termination condition",src:n(1817).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsxs)(t.p,{children:["Once you select the ",(0,i.jsx)(t.em,{children:"Run until"})," action, the default behavior of the green ",(0,i.jsx)(t.em,{children:"Run/Stop"})," button will change accordingly. The default behavior (",(0,i.jsx)(t.em,{children:"Run"}),", or ",(0,i.jsx)(t.em,{children:"Run until"}),") will be reset to ",(0,i.jsx)(t.em,{children:"Run"})," (means run forever) when Badger GUI is closed."]})}),"\n",(0,i.jsx)(t.p,{children:"For now, you can only use single termination condition. Multiple termination rules will be supported in the future."}),"\n",(0,i.jsx)(t.h3,{id:"reset-the-environment",children:"Reset the environment"}),"\n",(0,i.jsxs)(t.p,{children:["You can reset the environment to initial states after a run by clicking the ",(0,i.jsx)(t.em,{children:"Reset"})," button. Note that you can only reset the environment that you just run, and you cannot reset the environment in the middle of a run. To achieve the latter, ",(0,i.jsx)(t.a,{href:"#control-an-optimization-run",children:"terminate the run"})," first and then reset."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Reset the env",src:n(7202).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.h3,{id:"inspect-the-solutions-in-a-run",children:"Inspect the solutions in a run"}),"\n",(0,i.jsx)(t.p,{children:"You can either drag the yellow inspector line (the position will be synced across all monitors), or click inside the monitor, to select the solution you are interested in."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Inspect solutions",src:n(849).Z+"",width:"2784",height:"2078"})}),"\n",(0,i.jsx)(t.p,{children:"The know the exact values of the variables/objectives of that solution, drag the horizontal handle below the action buttons up to open the data table, the solution selected on the monitor will be highlighted in the data table. You can select any region of the table and copy the data as you do in Excel sheets."}),"\n",(0,i.jsx)(t.h3,{id:"jump-to-the-optimal-solution",children:"Jump to the optimal solution"}),"\n",(0,i.jsxs)(t.p,{children:["Click the star button to select the optimal solution according to the VOCS. Note that this action only selects the optimum, it does ",(0,i.jsx)(t.strong,{children:"NOT"})," set the environment with the selected solution. To dial in the optimal solution, ",(0,i.jsx)(t.a,{href:"#dial-in-the-selected-solution",children:"perform the dial in action"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Jump to optimum",src:n(5211).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.h3,{id:"dial-in-the-selected-solution",children:"Dial in the selected solution"}),"\n",(0,i.jsxs)(t.p,{children:["You can dial in any selected solution by clicking the ",(0,i.jsx)(t.em,{children:"Dial-in"})," button (with the right-down arrow icon) besides the star button. A confirmation dialog will be popped up to give you a heads-up, in case that you click the button by accident (could be dangerous when you are using Badger to optimize a real machine!)."]}),"\n",(0,i.jsx)(t.h3,{id:"change-the-horizontal-axis",children:"Change the horizontal axis"}),"\n",(0,i.jsxs)(t.p,{children:["You can show the run on iteration-based x-axis or time-based x-axis. Simply select the desired x-axis type (",(0,i.jsx)(t.code,{children:"Iteration"})," or ",(0,i.jsx)(t.code,{children:"Time"}),") in the ",(0,i.jsx)(t.em,{children:"X Axis"})," dropdown menu in the visualization configuration bar highlighted below."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Configure visualization options",src:n(5338).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsx)(t.p,{children:"You can configure the visualization options anytime, in the middle of a run or not."})}),"\n",(0,i.jsx)(t.h3,{id:"normalize-the-variables-for-better-visualization",children:"Normalize the variables for better visualization"}),"\n",(0,i.jsxs)(t.p,{children:["Sometimes it's convinient to show the variables in a normalized manner, so that you can observe all trends in the same frame. You can do that by selecting ",(0,i.jsx)(t.code,{children:"Normalized"})," in the ",(0,i.jsx)(t.em,{children:"Y Axis (Var)"})," dropdown menu. Check the ",(0,i.jsx)(t.em,{children:"Relative"})," checkbox would show the variable changes relative to its initial value, you can combine the ",(0,i.jsx)(t.em,{children:"Y Axis (Var)"})," options and the ",(0,i.jsx)(t.em,{children:"Relative"})," options to fit the visualization to your own needs."]}),"\n",(0,i.jsx)(t.h3,{id:"delete-a-run",children:"Delete a run"}),"\n",(0,i.jsxs)(t.p,{children:["Click the red ",(0,i.jsx)(t.em,{children:"Delete run"})," button (trash bin icon) at the bottom right of the run monitor to delete the current run shown on the run monitor. You'll be asked to confirm the delete action."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Delete a run",src:n(8064).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.h3,{id:"send-record-to-logbook",children:"Send record to logbook"}),"\n",(0,i.jsxs)(t.p,{children:["To send a log entry to the logbook directory",(0,i.jsx)(t.sup,{children:(0,i.jsx)(t.a,{href:"#user-content-fn-logdir",id:"user-content-fnref-logdir","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"1"})}),", click the blue button besides the ",(0,i.jsxs)(t.a,{href:"#delete-a-run",children:[(0,i.jsx)(t.em,{children:"Delete run"})," button"]}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Logbook and extension",src:n(1431).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.p,{children:"The log entry will include a screenshot of the run monitor and an xml file that summarizes the optimization run."}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsx)(t.p,{children:"Currently the log entry format is fixed. Flexible/customizable log entry support will be added in the future releases of Badger."})}),"\n",(0,i.jsx)(t.h3,{id:"use-data-analysisvisualization-extensions",children:"Use data analysis/visualization extensions"}),"\n",(0,i.jsxs)(t.p,{children:["You can open the extension menu by clicking the green ",(0,i.jsx)(t.em,{children:"Extension"})," button besides the ",(0,i.jsxs)(t.a,{href:"#send-record-to-logbook",children:[(0,i.jsx)(t.em,{children:"Logbook"})," button"]}),". Extensions in Badger provides capibilities more than simply monitoring the optimization curves. Extensions could parse the Gaussian model performance on the fly during the run, visualize the Pareto front in a multi-objective optimization, give insight on tuning knobs sensitivities wrt the objective, etc. Currently we have the following extensions shipped with Badger:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Pareto front viewer"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"We plan to implement the extension system in a similar manner to the plugin system in Badger, so that each extension could be developed, maintained, and installed separately, for maximum flexibility and extensibility."}),"\n",(0,i.jsx)(t.h2,{id:"routine-editor",children:"Routine editor"}),"\n",(0,i.jsx)(t.p,{children:"Routine editor enables the users to create/edit/save the routine easily. Below is a simple guide on the main features of the routine editor."}),"\n",(0,i.jsx)(t.h3,{id:"set-the-metadata",children:"Set the metadata"}),"\n",(0,i.jsxs)(t.p,{children:["Metadata of a routine contains the name and the description of the routine. You can change the description of a routine anytime by editing the content then clicking the ",(0,i.jsx)(t.em,{children:"Update"})," button. Note that if you are creating a new routine then you don't have to click the ",(0,i.jsx)(t.em,{children:"Update"})," button, since the metadata will be saved once you save the whole routine."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Set metadata",src:n(5412).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.h3,{id:"select-and-configure-the-generator",children:"Select and configure the generator"}),"\n",(0,i.jsxs)(t.p,{children:["To configure the generator in a routine, click the generator selector in the ",(0,i.jsx)(t.em,{children:"Algorithm"})," section, then edit the generator parameters in the ",(0,i.jsx)(t.em,{children:"Params"})," text box. Usually you don't need to change anything in the generator parameters -- the default values should work well for most cases."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Set generator",src:n(82).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsxs)(t.p,{children:["You can check the docs for the selected generator by clicking the ",(0,i.jsx)(t.em,{children:"Open Docs"})," button."]}),"\n",(0,i.jsx)(t.h3,{id:"select-and-configure-the-environment",children:"Select and configure the environment"}),"\n",(0,i.jsxs)(t.p,{children:["To configure the environment in a routine, click the environment selector in the ",(0,i.jsx)(t.em,{children:"Environment + VOCS"})," section, then edit the environment parameters (if any) in the ",(0,i.jsx)(t.em,{children:"Params"})," text box."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"Set environment",src:n(302).Z+"",width:"2784",height:"1720"})}),"\n",(0,i.jsx)(t.h3,{id:"configure-the-vocs",children:"Configure the VOCS"}),"\n",(0,i.jsxs)(t.p,{children:["The VOCS configuration panel is right below the environment configuration panel. It has 3 parts: variables configuration, objectives configuration, and constraints/states configurations (under the ",(0,i.jsx)(t.em,{children:"More"})," subsection)."]}),"\n",(0,i.jsxs)(t.p,{children:["On the variables configuration panel, you can filter the variables in the selected environment by its name, note that RegEx is supported here. For example, you can enter something like ",(0,i.jsx)(t.code,{children:"Q[1-4]*"})," to match the variables start with ",(0,i.jsx)(t.code,{children:"Q1"}),", ",(0,i.jsx)(t.code,{children:"Q2"}),", ",(0,i.jsx)(t.code,{children:"Q3"}),", and ",(0,i.jsx)(t.code,{children:"Q4"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["You can check the checkbox in front of each variable to include it in the optimization. Variables that are not selected will ",(0,i.jsx)(t.strong,{children:"NOT"})," be tuned during the run! You'll need to check at least one variable to make a valid routine."]}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsxs)(t.p,{children:["Click on the left-most blank cell in the variable table header (the one on top of all the variable checkboxes, besides the ",(0,i.jsx)(t.em,{children:"Name"})," header cell) will check/uncheck all the filtered variables (all variables that shown in the table when the ",(0,i.jsx)(t.em,{children:"Show Checked Only"})," checkbox is unchecked)."]})}),"\n",(0,i.jsx)("p",{align:"center",children:(0,i.jsx)("img",{alt:"Configure variables",src:n(3137).Z,style:{width:"70%"}})}),"\n",(0,i.jsxs)(t.p,{children:["Check the ",(0,i.jsx)(t.em,{children:"Show Checked Only"})," checkbox to only show the variables that would join the optimization."]}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.em,{children:"Min"})," and ",(0,i.jsx)(t.em,{children:"Max"})," columns in the variable table show the hard limit",(0,i.jsx)(t.sup,{children:(0,i.jsx)(t.a,{href:"#user-content-fn-hard-lim",id:"user-content-fnref-hard-lim","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"2"})})," of each variable (defined in the environment, usually limited by hardware). You can change the values in those two columns to adjust the variable ranges that you'd like to use in the optimization (say, you would like to start out conservatively -- so the variables should only change within 10% of the whole tunable ranges)."]}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsxs)(t.p,{children:["You can also limit the variable ranges by clicking the ",(0,i.jsx)(t.em,{children:"Limit Variable Range"})," button, it will give you options to limit all the selected variables ranges by percentage wrt their current values or the full tunable ranges in one go."]})}),"\n",(0,i.jsxs)(t.p,{children:["Then you'll want to set the initial points (from which solutions the optimization would start), you can do it by edit the table under the ",(0,i.jsx)(t.em,{children:"Initial Points"})," subsection. One common scenario is to start the optimization from the current solution, you can do that by clicking the ",(0,i.jsx)(t.em,{children:"Add Current"})," button, this will insert the current solution to the initial points table."]}),"\n",(0,i.jsxs)(t.p,{children:["Now we can go ahead and configure the objectives. It's very similar to the variables configuration, the main difference is that this time you'll need to specific the rule",(0,i.jsx)(t.sup,{children:(0,i.jsx)(t.a,{href:"#user-content-fn-rule",id:"user-content-fnref-rule","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"3"})})," of each objective."]}),"\n",(0,i.jsx)("p",{align:"center",children:(0,i.jsx)("img",{alt:"Configure objectives",src:n(1469).Z,style:{width:"70%"}})}),"\n",(0,i.jsxs)(t.p,{children:["If needed, you can add constraints and states",(0,i.jsx)(t.sup,{children:(0,i.jsx)(t.a,{href:"#user-content-fn-states",id:"user-content-fnref-states","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"4"})})," to the routine by configuring them in the expanded ",(0,i.jsx)(t.em,{children:"More"})," subsection. For constraints, check the ",(0,i.jsx)(t.em,{children:"Critical"})," checkbox would mark the corresponding constraint as a critical one, that would pause the optimization immediately once violated."]}),"\n",(0,i.jsx)(t.admonition,{type:"caution",children:(0,i.jsxs)(t.p,{children:["For the non-critical constraints, violations will ",(0,i.jsx)(t.strong,{children:"NOT"})," trigger a pause in a run, and it might not affect the optimization behavior at all if the chosen generator (say, ",(0,i.jsx)(t.code,{children:"neldermead"}),(0,i.jsx)(t.sup,{children:(0,i.jsx)(t.a,{href:"#user-content-fn-simplex",id:"user-content-fnref-simplex","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"5"})}),") doesn't support constraints."]})}),"\n",(0,i.jsx)("p",{align:"center",children:(0,i.jsx)("img",{alt:"Configure constraints and states",src:n(76).Z,style:{width:"70%"}})}),"\n",(0,i.jsxs)(t.section,{"data-footnotes":!0,className:"footnotes",children:[(0,i.jsx)(t.h2,{className:"sr-only",id:"footnote-label",children:"Footnotes"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{id:"user-content-fn-logdir",children:["\n",(0,i.jsxs)(t.p,{children:["Logbook directory is one of the configurations in Badger. You can check the current setting by running ",(0,i.jsx)(t.code,{children:"badger config"})," in terminal, then check the value of the ",(0,i.jsx)(t.code,{children:"BADGER_LOGBOOK_ROOT"})," key ",(0,i.jsx)(t.a,{href:"#user-content-fnref-logdir","data-footnote-backref":"","aria-label":"Back to reference 1",className:"data-footnote-backref",children:"\u21a9"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{id:"user-content-fn-hard-lim",children:["\n",(0,i.jsxs)(t.p,{children:["Those are ranges that should never be violated, no matter how the routine would be configured ",(0,i.jsx)(t.a,{href:"#user-content-fnref-hard-lim","data-footnote-backref":"","aria-label":"Back to reference 2",className:"data-footnote-backref",children:"\u21a9"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{id:"user-content-fn-rule",children:["\n",(0,i.jsxs)(t.p,{children:["Direction of the optimization, either ",(0,i.jsx)(t.code,{children:"MAXIMIZE"})," or ",(0,i.jsx)(t.code,{children:"MINIMIZE"})," ",(0,i.jsx)(t.a,{href:"#user-content-fnref-rule","data-footnote-backref":"","aria-label":"Back to reference 3",className:"data-footnote-backref",children:"\u21a9"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{id:"user-content-fn-states",children:["\n",(0,i.jsxs)(t.p,{children:["Variables or observables that you'd like to monitor during the run, but won't join the run directly ",(0,i.jsx)(t.a,{href:"#user-content-fnref-states","data-footnote-backref":"","aria-label":"Back to reference 4",className:"data-footnote-backref",children:"\u21a9"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{id:"user-content-fn-simplex",children:["\n",(0,i.jsxs)(t.p,{children:["Aka Simplex ",(0,i.jsx)(t.a,{href:"#user-content-fnref-simplex","data-footnote-backref":"","aria-label":"Back to reference 5",className:"data-footnote-backref",children:"\u21a9"})]}),"\n"]}),"\n"]}),"\n"]})]})}function d(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},76:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/const-5bcaffaebb43bd3cfbb4aef21f15c72a.png"},1469:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/obj-ef68266ca3f6f3b8ccf096262469853c.png"},3137:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/var-d822f4429c98425f996d18ab63869003.png"},7202:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/control-6093247235285dea876d9f78db347659.png"},4245:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/create_new_routine-56ddde3bb0995b5fd4737de09fccedc2.png"},1431:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/ctrl_misc-045bc1ef53442a1bfe2b1b6edaf9e276.png"},6169:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/delete_routine-f4138a20ffb79f2d80f4017ac4ce429c.png"},8064:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/delete_run-c7585c42abc4d891d72c824cb261da5a.png"},1144:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/export_import_routines-73fe50b02fb2177b5ab579d15e180de9.png"},2441:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/filter_routines-79766aa9181762ebed1e2198ce343f1c.png"},193:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/history_browser-9fcbac20951a9465229be19606ccb3c3.png"},937:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/history_dropdown-47eebf0e6413f150ccfe28e222bf3805.png"},351:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/hover_on_routine-c36631e9d274acab130661e66217f631.png"},849:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/inspect_sol-882235e407931101b2ac34456221c4f2.png"},5211:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/jump_to_opt-f6d0f7a9cde9986021152fb9d6499b0e.png"},5302:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/routine_editor-cb93cadbd434db75fb4244dd81e7f034.png"},302:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/set_env-2eca47029e68a10e40289efebf20a61e.png"},82:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/set_gen-1d96ad5a85afdfc4777213499c57fe69.png"},5412:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/set_meta-ebb3a23dae9a4d4f4d60904eaa3277a1.png"},2124:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/settings-6f10cc35e9b79d337b02bdddae093c78.png"},1817:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/tc-9b337fefa8578fbb81bd8e02eb9eb901.png"},5338:(e,t,n)=>{n.d(t,{Z:()=>i});const i=n.p+"assets/images/vis_options-43f4587e48e7e864f7c452507765e07a.png"},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>s});var i=n(7294);const o={},r=i.createContext(o);function s(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.21f1c8ba.js b/assets/js/935f2afb.3f9257d2.js similarity index 78% rename from assets/js/935f2afb.21f1c8ba.js rename to assets/js/935f2afb.3f9257d2.js index 5660032..0f3452a 100644 --- a/assets/js/935f2afb.21f1c8ba.js +++ b/assets/js/935f2afb.3f9257d2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkbadger_home=self.webpackChunkbadger_home||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":"unreleased","badge":true,"noIndex":false,"className":"docs-version-current","isLast":false,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Introduction","href":"/Badger/docs/next/intro","docId":"intro","unlisted":false},{"type":"category","label":"Getting Started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Installation","href":"/Badger/docs/next/getting-started/installation","docId":"getting-started/installation","unlisted":false},{"type":"link","label":"Tutorial (GUI mode)","href":"/Badger/docs/next/getting-started/tutorial_0","docId":"getting-started/tutorial_0","unlisted":false},{"type":"link","label":"Tutorial (CLI mode)","href":"/Badger/docs/next/getting-started/tutorial_1","docId":"getting-started/tutorial_1","unlisted":false}]},{"type":"category","label":"Guides","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"API Usage","href":"/Badger/docs/next/guides/api-usage","docId":"guides/api-usage","unlisted":false},{"type":"link","label":"CLI Usage","href":"/Badger/docs/next/guides/cli-usage","docId":"guides/cli-usage","unlisted":false},{"type":"link","label":"GUI Usage","href":"/Badger/docs/next/guides/gui-usage","docId":"guides/gui-usage","unlisted":false},{"type":"link","label":"Create a plugin","href":"/Badger/docs/next/guides/create-a-plugin","docId":"guides/create-a-plugin","unlisted":false},{"type":"link","label":"Implement an extension","href":"/Badger/docs/next/guides/implement-an-extension","docId":"guides/implement-an-extension","unlisted":false}]}]},"docs":{"getting-started/installation":{"id":"getting-started/installation","title":"Installation","description":"Badger is essentially a python package. It\'s recommended to install and test it in a separate python virtual environment before using it in a production env.","sidebar":"tutorialSidebar"},"getting-started/tutorial_0":{"id":"getting-started/tutorial_0","title":"Tutorial (GUI mode)","description":"Make sure you have Badger installed and setup.","sidebar":"tutorialSidebar"},"getting-started/tutorial_1":{"id":"getting-started/tutorial_1","title":"Tutorial (CLI mode)","description":"Make sure you have Badger installed and setup.","sidebar":"tutorialSidebar"},"guides/api-usage":{"id":"guides/api-usage","title":"API Usage","description":"Badger can be imported as a regular python package, and you could use the plugins/utils that Badger offers in your own python script.","sidebar":"tutorialSidebar"},"guides/cli-usage":{"id":"guides/cli-usage","title":"CLI Usage","description":"For all the implemented and planned CLI usage, please refer to these slides. We\'ll highlight several common CLI use cases of Badger in the following sections.","sidebar":"tutorialSidebar"},"guides/create-a-plugin":{"id":"guides/create-a-plugin","title":"Create a plugin","description":"Plugins have three types:","sidebar":"tutorialSidebar"},"guides/gui-usage":{"id":"guides/gui-usage","title":"GUI Usage","description":"Once you launch Badger in GUI mode, you\'ll have various Badger features to explore. You can search through this page to get to the guide on any specify GUI feature, or if you believe a guide is missing for the topic you are interested in, please consider raising an issue here or shooting us an email, many thanks :)","sidebar":"tutorialSidebar"},"guides/implement-an-extension":{"id":"guides/implement-an-extension","title":"Implement an extension","description":"WIP","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Introduction","description":"Badger is an optimizer specifically designed for Accelerator Control Room (ACR).","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkbadger_home=self.webpackChunkbadger_home||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":"unreleased","badge":true,"noIndex":false,"className":"docs-version-current","isLast":false,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Introduction","href":"/Badger/docs/next/intro","docId":"intro","unlisted":false},{"type":"category","label":"Getting Started","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Installation","href":"/Badger/docs/next/getting-started/installation","docId":"getting-started/installation","unlisted":false},{"type":"link","label":"Tutorial (GUI mode)","href":"/Badger/docs/next/getting-started/tutorial_0","docId":"getting-started/tutorial_0","unlisted":false},{"type":"link","label":"Tutorial (CLI mode)","href":"/Badger/docs/next/getting-started/tutorial_1","docId":"getting-started/tutorial_1","unlisted":false}]},{"type":"category","label":"Guides","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"API Usage","href":"/Badger/docs/next/guides/api-usage","docId":"guides/api-usage","unlisted":false},{"type":"link","label":"CLI Usage","href":"/Badger/docs/next/guides/cli-usage","docId":"guides/cli-usage","unlisted":false},{"type":"link","label":"GUI Usage","href":"/Badger/docs/next/guides/gui-usage","docId":"guides/gui-usage","unlisted":false},{"type":"link","label":"Create a plugin","href":"/Badger/docs/next/guides/create-a-plugin","docId":"guides/create-a-plugin","unlisted":false},{"type":"link","label":"Implement an extension","href":"/Badger/docs/next/guides/implement-an-extension","docId":"guides/implement-an-extension","unlisted":false}]}]},"docs":{"getting-started/installation":{"id":"getting-started/installation","title":"Installation","description":"Badger is essentially a python package. It\'s recommended to install and test it in a separate python virtual environment before using it in a production env.","sidebar":"tutorialSidebar"},"getting-started/tutorial_0":{"id":"getting-started/tutorial_0","title":"Tutorial (GUI mode)","description":"Make sure you have Badger installed and setup.","sidebar":"tutorialSidebar"},"getting-started/tutorial_1":{"id":"getting-started/tutorial_1","title":"Tutorial (CLI mode)","description":"Make sure you have Badger installed and setup.","sidebar":"tutorialSidebar"},"guides/api-usage":{"id":"guides/api-usage","title":"API Usage","description":"Badger can be imported as a regular python package, and you could use the plugins/utils that Badger offers in your own python script.","sidebar":"tutorialSidebar"},"guides/cli-usage":{"id":"guides/cli-usage","title":"CLI Usage","description":"For all the implemented and planned CLI usage, please refer to these slides. We\'ll highlight several common CLI use cases of Badger in the following sections.","sidebar":"tutorialSidebar"},"guides/create-a-plugin":{"id":"guides/create-a-plugin","title":"Create a plugin","description":"Plugins have two types:","sidebar":"tutorialSidebar"},"guides/gui-usage":{"id":"guides/gui-usage","title":"GUI Usage","description":"Once you launch Badger in GUI mode, you\'ll have various Badger features to explore. You can search through this page to get to the guide on any specify GUI feature, or if you believe a guide is missing for the topic you are interested in, please consider raising an issue here or shooting us an email, many thanks :)","sidebar":"tutorialSidebar"},"guides/implement-an-extension":{"id":"guides/implement-an-extension","title":"Implement an extension","description":"WIP","sidebar":"tutorialSidebar"},"intro":{"id":"intro","title":"Introduction","description":"Badger is an optimizer specifically designed for Accelerator Control Room (ACR).","sidebar":"tutorialSidebar"}}}')}}]); \ No newline at end of file diff --git a/assets/js/c7e3ca8c.8350ae29.js b/assets/js/c7e3ca8c.8350ae29.js new file mode 100644 index 0000000..c2d177b --- /dev/null +++ b/assets/js/c7e3ca8c.8350ae29.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkbadger_home=self.webpackChunkbadger_home||[]).push([[8978],{6547:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>h,frontMatter:()=>i,metadata:()=>o,toc:()=>c});var a=t(5893),r=t(1151);const i={sidebar_position:4},s="Create a plugin",o={id:"guides/create-a-plugin",title:"Create a plugin",description:"Plugins have two types:",source:"@site/docs/guides/create-a-plugin.md",sourceDirName:"guides",slug:"/guides/create-a-plugin",permalink:"/Badger/docs/next/guides/create-a-plugin",draft:!1,unlisted:!1,editUrl:"https://github.com/SLAC-ML/Badger-Home/edit/master/docs/guides/create-a-plugin.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"GUI Usage",permalink:"/Badger/docs/next/guides/gui-usage"},next:{title:"Implement an extension",permalink:"/Badger/docs/next/guides/implement-an-extension"}},l={},c=[{value:"Create an interface plugin",id:"create-an-interface-plugin",level:2},{value:"Create an environment plugin",id:"create-an-environment-plugin",level:2},{value:"The basics",id:"the-basics",level:3},{value:"Advanced topics",id:"advanced-topics",level:3},{value:"Specify variable range",id:"specify-variable-range",level:4},{value:"Incorperate hyper-parameters",id:"incorperate-hyper-parameters",level:4},{value:"Check variable readout",id:"check-variable-readout",level:4},{value:"Delayed observation",id:"delayed-observation",level:4}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",section:"section",strong:"strong",sup:"sup",ul:"ul",...(0,r.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{id:"create-a-plugin",children:"Create a plugin"}),"\n",(0,a.jsx)(n.p,{children:"Plugins have two types:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Interface: class"}),"\n",(0,a.jsx)(n.li,{children:"Environment: class"}),"\n"]}),"\n",(0,a.jsxs)(n.p,{children:["Interface is the low-level layer between the machine/simulation and the environment that deals with the fundamental communications. It can be treated as an abstract of the underlying control system. Interface is optional ",(0,a.jsx)(n.strong,{children:"BUT"})," recommended! The pros of having an interface:"]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["It can be reused across different environments, so that you don't have to rewrite the same communication logic again and again",(0,a.jsx)(n.sup,{children:(0,a.jsx)(n.a,{href:"#user-content-fn-intf-exp",id:"user-content-fnref-intf-exp","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"1"})})]}),"\n",(0,a.jsxs)(n.li,{children:["Unlike the environment, all the raw data that go through the interface can be recorded and archived, those raw data could include the intermediate measurements/observations that used to calculate the objectives/constraints/states",(0,a.jsx)(n.sup,{children:(0,a.jsx)(n.a,{href:"#user-content-fn-env-cons",id:"user-content-fnref-env-cons","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"2"})})]}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"Environment, on the other hand, abstracts the specific machine to be optimized. It contains the necessary information regarding the tuning knobs and the measurements, as well as the way to get and/or set them. Environment is the core of defining the optimization problem in Badger and it is mandatory."}),"\n",(0,a.jsx)(n.p,{children:"This guide will go through the basic components that compose a custom interface/environment by creating a simplest but full-featured interface/environment plugin. Let's get started."}),"\n",(0,a.jsx)(n.h2,{id:"create-an-interface-plugin",children:"Create an interface plugin"}),"\n",(0,a.jsx)(n.p,{children:"The file structure of a Badger interface plugin looks like this:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-shell",metastring:'title="Badger interface plugin file structure"',children:"|--\n |--__init__.py\n |--configs.yaml\n |--README.md\n |--...\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Let's create a simple interface that has 9 channels (8 input channels and 1 output channel), where the output channel is the L2 norm of all the input channel values. We'll name it ",(0,a.jsx)(n.code,{children:"myintf"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:["Assume that the Badger plugin root has been pointed to some directory ",(0,a.jsx)(n.code,{children:"PLUGIN_ROOT"})," on your computer, then we can create a new folder ",(0,a.jsx)(n.code,{children:"myintf"})," inside ",(0,a.jsx)(n.code,{children:"PLUGIN_ROOT/interfaces/"}),", and we put the following files with the given content into the newly created folder:"]}),"\n",(0,a.jsx)(n.p,{children:"First the main script file:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",metastring:'title="myintf/__init__.py"',children:"from badger import interface\n\n\nclass Interface(interface.Interface):\n\n name = 'myintf'\n\n def get_values(self, channel_names: list):\n pass\n\n def set_values(self, channel_inputs: dict):\n pass\n"})}),"\n",(0,a.jsx)(n.p,{children:"Then the configs file:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-yaml",metastring:'title="myintf/configs.yaml"',children:'---\nname: myintf\nversion: "0.1"\ndependencies:\n - badger-opt\n'})}),"\n",(0,a.jsx)(n.h2,{id:"create-an-environment-plugin",children:"Create an environment plugin"}),"\n",(0,a.jsx)(n.p,{children:'To let Badger deal with your own optimization problem, you\'ll need to turn the problem into a custom environment plugin first. An environment in Badger defines how Badger could interact with the "control system" upon which the optimization problem forms up. To be more specific, Badger wants to know:'}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"What variables can be tuned"}),"\n",(0,a.jsx)(n.li,{children:"What are the ranges for the tunable variables"}),"\n",(0,a.jsx)(n.li,{children:"What observations are available (objectives, constraints, anything you would like to monitor in the optimization)"}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"Plus (actually more importantly):"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"How to tune one variable"}),"\n",(0,a.jsx)(n.li,{children:"How to get one observation"}),"\n"]}),"\n",(0,a.jsxs)(n.p,{children:["And you incorporate those knowledge into Badger by inheriting the ",(0,a.jsx)(n.code,{children:"Environment"})," base class provided by the Badger core, and implementing the corresponding methods."]}),"\n",(0,a.jsx)(n.p,{children:"Let's get a better idea about it by creating a simple custom environment plugin for Badger from the ground up."}),"\n",(0,a.jsx)(n.h3,{id:"the-basics",children:"The basics"}),"\n",(0,a.jsx)(n.p,{children:"First off, let's create a file structure like the following:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-shell",metastring:'title="Simplest environment plugin file structure"',children:"|--myenv\n |--__init__.py\n |--configs.yaml\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Here we'll name our simple custom env as ",(0,a.jsx)(n.code,{children:"myenv"}),", as the folder name shows."]}),"\n",(0,a.jsxs)(n.p,{children:["Then put the boilerplate code below into ",(0,a.jsx)(n.code,{children:"__init__.py"}),":"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",metastring:'title="myenv/__init__.py"',children:"from badger import environment\nfrom badger.interface import Interface\n\n\nclass Environment(environment.Environment):\n\n name = 'myenv'\n\n def __init__(self, interface: Interface, params):\n super().__init__(interface, params)\n # Add other logic, try to not do time-consuming stuff here\n\n @staticmethod\n def list_vars():\n return []\n\n @staticmethod\n def list_obses():\n return []\n\n def _get_var(self, var):\n return 0\n\n def _set_var(self, var, x):\n pass\n\n def _get_obs(self, obs):\n return 0\n"})}),"\n",(0,a.jsx)(n.p,{children:"Several things to note regarding the boilerplate code:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["It should have a class variable called ",(0,a.jsx)(n.code,{children:"name"}),", and it should match the folder name of the plugin"]}),"\n",(0,a.jsxs)(n.li,{children:["There are 5 methods that are required to be implemented to create a proper Badger env:","\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"list_vars"}),": Get a list of all the supported variables"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"list_obses"}),": Get a list of all the supported observations"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"_get_var"}),": Get the value of a specific variable"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"_set_var"}),": Set a specific variable to some value"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.code,{children:"_get_obs"}),": Get the value of a specific observation"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(n.admonition,{type:"tip",children:(0,a.jsxs)(n.p,{children:["As the comment says, try to avoid doing time-consuming thing in ",(0,a.jsx)(n.code,{children:"__init__"})," method. Badger would create an instance of the environment when users try to get the details of the plugin (say, when ",(0,a.jsx)(n.code,{children:"badger env myenv"})," is called in CLI mode), so just put some light-computing code there in the constructor would provide the users a smoother experience."]})}),"\n",(0,a.jsxs)(n.p,{children:["Okay, now we can start to implement the methods. Assume that our sample environment has 3 variables: ",(0,a.jsx)(n.code,{children:"x"}),", ",(0,a.jsx)(n.code,{children:"y"}),", and ",(0,a.jsx)(n.code,{children:"z"}),", it also has 2 observations: ",(0,a.jsx)(n.code,{children:"norm"}),", and ",(0,a.jsx)(n.code,{children:"mean"}),". Then the ",(0,a.jsx)(n.code,{children:"list_vars"})," and ",(0,a.jsx)(n.code,{children:"list_obses"})," methods should look like:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:" @staticmethod\n def list_vars():\n return ['x', 'y', 'z']\n\n @staticmethod\n def list_obses():\n return ['norm', 'mean']\n"})}),"\n",(0,a.jsx)(n.p,{children:"Our custom env is so simple that we don't really need an interface here. Let's implement the getter and setter for the variables:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:" def __init__(self, interface: Interface, params):\n super().__init__(interface, params)\n self.variables = {\n 'x': 0,\n 'y': 0,\n 'z': 0,\n }\n\n def _get_var(self, var):\n return self.variables[var]\n\n def _set_var(self, var, x):\n self.variables[var] = x\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Here we use a dictionary called ",(0,a.jsx)(n.code,{children:"variables"})," to hold the values for the variables."]}),"\n",(0,a.jsx)(n.p,{children:"Now let's add observation related logic:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:" def _get_obs(self, obs):\n x = self.variables['x']\n y = self.variables['y']\n z = self.variables['z']\n\n if obs == 'norm':\n return (x ** 2 + y ** 2 + z ** 2) ** 0.5\n elif obs == 'mean':\n return (x + y + z) / 3\n"})}),"\n",(0,a.jsxs)(n.p,{children:["At this point, the content of ",(0,a.jsx)(n.code,{children:"__init__.py"})," should be:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",metastring:'title="myenv/__init__.py"',children:"from badger import environment\nfrom badger.interface import Interface\n\n\nclass Environment(environment.Environment):\n\n name = 'myenv'\n\n def __init__(self, interface: Interface, params):\n super().__init__(interface, params)\n self.variables = {\n 'x': 0,\n 'y': 0,\n 'z': 0,\n }\n\n @staticmethod\n def list_vars():\n return ['x', 'y', 'z']\n\n @staticmethod\n def list_obses():\n return ['norm', 'mean']\n\n def _get_var(self, var):\n return self.variables[var]\n\n def _set_var(self, var, x):\n self.variables[var] = x\n\n def _get_obs(self, obs):\n x = self.variables['x']\n y = self.variables['y']\n z = self.variables['z']\n\n if obs == 'norm':\n return (x ** 2 + y ** 2 + z ** 2) ** 0.5\n elif obs == 'mean':\n return (x + y + z) / 3\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Alright! Our little env is almost done -- even though it doesn\u2019t do much, it already has everything that we need for a Badger environment! To make the plugin complete, we should also incorporate some meta data (such as version number) of our env into ",(0,a.jsx)(n.code,{children:"configs.yaml"}),":"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",metastring:'title="myenv/configs.yaml"',children:'---\nname: myenv\nversion: "0.1"\ndependencies:\n - badger-opt\n'})}),"\n",(0,a.jsxs)(n.p,{children:["Congrats! Our custom env plugin is ready to go! Let's put the whole folder under ",(0,a.jsx)(n.code,{children:"BADGER_PLUGIN_ROOT/environments"}),", then executing the following command in a terminal (in which the Badger package is available, of course):"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-shell",children:"badger env myenv\n"})}),"\n",(0,a.jsx)(n.p,{children:"The printouts should look like below. Yay!"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-yaml",children:"name: myenv\nversion: '0.1'\ndependencies:\n - badger-opt\nparams: null\nvariables:\n - x: 0 -> 1\n - y: 0 -> 1\n - z: 0 -> 1\nobservations:\n - norm\n - mean\n"})}),"\n",(0,a.jsxs)(n.admonition,{type:"caution",children:[(0,a.jsxs)(n.p,{children:["If you use an older version of Badger, you would encounter the following error when you do ",(0,a.jsx)(n.code,{children:"badger env myenv"}),":"]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{children:"Can't instantiate abstract class Environment with abstract method get_default_params\n"})}),(0,a.jsxs)(n.p,{children:["To get around this issue, simply put the following method inside the ",(0,a.jsx)(n.code,{children:"myenv"})," environment class definition:"]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:" @staticmethod\n def get_default_params():\n return None\n"})}),(0,a.jsxs)(n.p,{children:["Then you should get the expected printouts. The usage of the ",(0,a.jsx)(n.code,{children:"get_default_params"})," method will be covered in ",(0,a.jsx)(n.a,{href:"#incorperate-hyper-parameters",children:"future sections"}),"."]})]}),"\n",(0,a.jsxs)(n.p,{children:["Now you can take ",(0,a.jsx)(n.code,{children:"myenv"})," for a spin -- just write some routine configs and run some algorithm (say, ",(0,a.jsx)(n.code,{children:"silly"})," the random sampler) on our newly created env, to see if everything works as expected."]}),"\n",(0,a.jsx)(n.h3,{id:"advanced-topics",children:"Advanced topics"}),"\n",(0,a.jsx)(n.h4,{id:"specify-variable-range",children:"Specify variable range"}),"\n",(0,a.jsx)(n.h4,{id:"incorperate-hyper-parameters",children:"Incorperate hyper-parameters"}),"\n",(0,a.jsx)(n.h4,{id:"check-variable-readout",children:"Check variable readout"}),"\n",(0,a.jsx)(n.h4,{id:"delayed-observation",children:"Delayed observation"}),"\n",(0,a.jsxs)(n.section,{"data-footnotes":!0,className:"footnotes",children:[(0,a.jsx)(n.h2,{className:"sr-only",id:"footnote-label",children:"Footnotes"}),"\n",(0,a.jsxs)(n.ol,{children:["\n",(0,a.jsxs)(n.li,{id:"user-content-fn-intf-exp",children:["\n",(0,a.jsxs)(n.p,{children:["One example is that both LCLS and NSLS use Epics as the control system, so an Epics interface can be shared between the LCLS and NSLS Badger environments ",(0,a.jsx)(n.a,{href:"#user-content-fnref-intf-exp","data-footnote-backref":"","aria-label":"Back to reference 1",className:"data-footnote-backref",children:"\u21a9"})]}),"\n"]}),"\n",(0,a.jsxs)(n.li,{id:"user-content-fn-env-cons",children:["\n",(0,a.jsxs)(n.p,{children:["Environment can only record the VOCS, not the intermediate measurements. Say, to calculate the FEL pulse energy, one needs to average over a buffer of values. It is the averaged value being recorded in the archived run data, not the raw buffers ",(0,a.jsx)(n.a,{href:"#user-content-fnref-env-cons","data-footnote-backref":"","aria-label":"Back to reference 2",className:"data-footnote-backref",children:"\u21a9"})]}),"\n"]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>o,a:()=>s});var a=t(7294);const r={},i=a.createContext(r);function s(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/c7e3ca8c.88408eab.js b/assets/js/c7e3ca8c.88408eab.js deleted file mode 100644 index dcbd63c..0000000 --- a/assets/js/c7e3ca8c.88408eab.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbadger_home=self.webpackChunkbadger_home||[]).push([[8978],{6547:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>o,contentTitle:()=>s,default:()=>h,frontMatter:()=>a,metadata:()=>l,toc:()=>d});var t=r(5893),i=r(1151);const a={sidebar_position:4},s="Create a plugin",l={id:"guides/create-a-plugin",title:"Create a plugin",description:"Plugins have three types:",source:"@site/docs/guides/create-a-plugin.md",sourceDirName:"guides",slug:"/guides/create-a-plugin",permalink:"/Badger/docs/next/guides/create-a-plugin",draft:!1,unlisted:!1,editUrl:"https://github.com/SLAC-ML/Badger-Home/edit/master/docs/guides/create-a-plugin.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"tutorialSidebar",previous:{title:"GUI Usage",permalink:"/Badger/docs/next/guides/gui-usage"},next:{title:"Implement an extension",permalink:"/Badger/docs/next/guides/implement-an-extension"}},o={},d=[{value:"Create an algorithm plugin",id:"create-an-algorithm-plugin",level:2},{value:"Create an interface plugin",id:"create-an-interface-plugin",level:2},{value:"Create an environment plugin",id:"create-an-environment-plugin",level:2},{value:"The basics",id:"the-basics",level:3},{value:"Advanced topics",id:"advanced-topics",level:3},{value:"Specify variable range",id:"specify-variable-range",level:4},{value:"Incorperate hyper-parameters",id:"incorperate-hyper-parameters",level:4},{value:"Check variable readout",id:"check-variable-readout",level:4},{value:"Delayed observation",id:"delayed-observation",level:4}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"create-a-plugin",children:"Create a plugin"}),"\n",(0,t.jsx)(n.p,{children:"Plugins have three types:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Algorithm: function"}),"\n",(0,t.jsx)(n.li,{children:"Interface: class"}),"\n",(0,t.jsx)(n.li,{children:"Environment: class"}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"create-an-algorithm-plugin",children:"Create an algorithm plugin"}),"\n",(0,t.jsx)(n.h2,{id:"create-an-interface-plugin",children:"Create an interface plugin"}),"\n",(0,t.jsx)(n.h2,{id:"create-an-environment-plugin",children:"Create an environment plugin"}),"\n",(0,t.jsx)(n.p,{children:'To let Badger deal with your own optimization problem, you\'ll need to turn the problem into a custom environment plugin first. An environment in Badger defines how Badger could interact with the "control system" upon which the optimization problem forms up. To be more specific, Badger wants to know:'}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"What variables can be tuned"}),"\n",(0,t.jsx)(n.li,{children:"What are the ranges for the tunable variables"}),"\n",(0,t.jsx)(n.li,{children:"What observations are available (objectives, constraints, anything you would like to monitor in the optimization)"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"Plus (actually more importantly):"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"How to tune one variable"}),"\n",(0,t.jsx)(n.li,{children:"How to get one observation"}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["And you incorporate those knowledge into Badger by inheriting the ",(0,t.jsx)(n.code,{children:"Environment"})," base class provided by the Badger core, and implementing the corresponding methods."]}),"\n",(0,t.jsx)(n.p,{children:"Let's get a better idea about it by creating a simple custom environment plugin for Badger from the ground up."}),"\n",(0,t.jsx)(n.h3,{id:"the-basics",children:"The basics"}),"\n",(0,t.jsx)(n.p,{children:"First off, let's create a file structure like the following:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",metastring:'title="Simplest environment plugin file structure"',children:"|--myenv\n |--__init__.py\n |--configs.yaml\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Here we'll name our simple custom env as ",(0,t.jsx)(n.code,{children:"myenv"}),", as the folder name shows."]}),"\n",(0,t.jsxs)(n.p,{children:["Then put the boilerplate code below into ",(0,t.jsx)(n.code,{children:"__init__.py"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",metastring:'title="myenv/__init__.py"',children:"from badger import environment\nfrom badger.interface import Interface\n\n\nclass Environment(environment.Environment):\n\n name = 'myenv'\n\n def __init__(self, interface: Interface, params):\n super().__init__(interface, params)\n # Add other logic, try to not do time-consuming stuff here\n\n @staticmethod\n def list_vars():\n return []\n\n @staticmethod\n def list_obses():\n return []\n\n def _get_var(self, var):\n return 0\n\n def _set_var(self, var, x):\n pass\n\n def _get_obs(self, obs):\n return 0\n"})}),"\n",(0,t.jsx)(n.p,{children:"Several things to note regarding the boilerplate code:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["It should have a class variable called ",(0,t.jsx)(n.code,{children:"name"}),", and it should match the folder name of the plugin"]}),"\n",(0,t.jsxs)(n.li,{children:["There are 5 methods that are required to be implemented to create a proper Badger env:","\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"list_vars"}),": Get a list of all the supported variables"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"list_obses"}),": Get a list of all the supported observations"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"_get_var"}),": Get the value of a specific variable"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"_set_var"}),": Set a specific variable to some value"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"_get_obs"}),": Get the value of a specific observation"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["As the comment says, try to avoid doing time-consuming thing in ",(0,t.jsx)(n.code,{children:"__init__"})," method. Badger would create an instance of the environment when users try to get the details of the plugin (say, when ",(0,t.jsx)(n.code,{children:"badger env myenv"})," is called in CLI mode), so just put some light-computing code there in the constructor would provide the users a smoother experience."]})}),"\n",(0,t.jsxs)(n.p,{children:["Okay, now we can start to implement the methods. Assume that our sample environment has 3 variables: ",(0,t.jsx)(n.code,{children:"x"}),", ",(0,t.jsx)(n.code,{children:"y"}),", and ",(0,t.jsx)(n.code,{children:"z"}),", it also has 2 observations: ",(0,t.jsx)(n.code,{children:"norm"}),", and ",(0,t.jsx)(n.code,{children:"mean"}),". Then the ",(0,t.jsx)(n.code,{children:"list_vars"})," and ",(0,t.jsx)(n.code,{children:"list_obses"})," methods should look like:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:" @staticmethod\n def list_vars():\n return ['x', 'y', 'z']\n\n @staticmethod\n def list_obses():\n return ['norm', 'mean']\n"})}),"\n",(0,t.jsx)(n.p,{children:"Our custom env is so simple that we don't really need an interface here. Let's implement the getter and setter for the variables:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:" def __init__(self, interface: Interface, params):\n super().__init__(interface, params)\n self.variables = {\n 'x': 0,\n 'y': 0,\n 'z': 0,\n }\n\n def _get_var(self, var):\n return self.variables[var]\n\n def _set_var(self, var, x):\n self.variables[var] = x\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Here we use a dictionary called ",(0,t.jsx)(n.code,{children:"variables"})," to hold the values for the variables."]}),"\n",(0,t.jsx)(n.p,{children:"Now let's add observation related logic:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:" def _get_obs(self, obs):\n x = self.variables['x']\n y = self.variables['y']\n z = self.variables['z']\n\n if obs == 'norm':\n return (x ** 2 + y ** 2 + z ** 2) ** 0.5\n elif obs == 'mean':\n return (x + y + z) / 3\n"})}),"\n",(0,t.jsxs)(n.p,{children:["At this point, the content of ",(0,t.jsx)(n.code,{children:"__init__.py"})," should be:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",metastring:'title="myenv/__init__.py"',children:"from badger import environment\nfrom badger.interface import Interface\n\n\nclass Environment(environment.Environment):\n\n name = 'myenv'\n\n def __init__(self, interface: Interface, params):\n super().__init__(interface, params)\n self.variables = {\n 'x': 0,\n 'y': 0,\n 'z': 0,\n }\n\n @staticmethod\n def list_vars():\n return ['x', 'y', 'z']\n\n @staticmethod\n def list_obses():\n return ['norm', 'mean']\n\n def _get_var(self, var):\n return self.variables[var]\n\n def _set_var(self, var, x):\n self.variables[var] = x\n\n def _get_obs(self, obs):\n x = self.variables['x']\n y = self.variables['y']\n z = self.variables['z']\n\n if obs == 'norm':\n return (x ** 2 + y ** 2 + z ** 2) ** 0.5\n elif obs == 'mean':\n return (x + y + z) / 3\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Alright! Our little env is almost done -- even though it doesn\u2019t do much, it already has everything that we need for a Badger environment! To make the plugin complete, we should also incorporate some meta data (such as version number) of our env into ",(0,t.jsx)(n.code,{children:"configs.yaml"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",metastring:'title="myenv/configs.yaml"',children:'---\nname: myenv\nversion: "0.1"\ndependencies:\n - badger-opt\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Congrats! Our custom env plugin is ready to go! Let's put the whole folder under ",(0,t.jsx)(n.code,{children:"BADGER_PLUGIN_ROOT/environments"}),", then executing the following command in a terminal (in which the Badger package is available, of course):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"badger env myenv\n"})}),"\n",(0,t.jsx)(n.p,{children:"The printouts should look like below. Yay!"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"name: myenv\nversion: '0.1'\ndependencies:\n - badger-opt\nparams: null\nvariables:\n - x: 0 -> 1\n - y: 0 -> 1\n - z: 0 -> 1\nobservations:\n - norm\n - mean\n"})}),"\n",(0,t.jsxs)(n.admonition,{type:"caution",children:[(0,t.jsxs)(n.p,{children:["If you use an older version of Badger, you would encounter the following error when you do ",(0,t.jsx)(n.code,{children:"badger env myenv"}),":"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"Can't instantiate abstract class Environment with abstract method get_default_params\n"})}),(0,t.jsxs)(n.p,{children:["To get around this issue, simply put the following method inside the ",(0,t.jsx)(n.code,{children:"myenv"})," environment class definition:"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:" @staticmethod\n def get_default_params():\n return None\n"})}),(0,t.jsxs)(n.p,{children:["Then you should get the expected printouts. The usage of the ",(0,t.jsx)(n.code,{children:"get_default_params"})," method will be covered in ",(0,t.jsx)(n.a,{href:"#incorperate-hyper-parameters",children:"future sections"}),"."]})]}),"\n",(0,t.jsxs)(n.p,{children:["Now you can take ",(0,t.jsx)(n.code,{children:"myenv"})," for a spin -- just write some routine configs and run some algorithm (say, ",(0,t.jsx)(n.code,{children:"silly"})," the random sampler) on our newly created env, to see if everything works as expected."]}),"\n",(0,t.jsx)(n.h3,{id:"advanced-topics",children:"Advanced topics"}),"\n",(0,t.jsx)(n.h4,{id:"specify-variable-range",children:"Specify variable range"}),"\n",(0,t.jsx)(n.h4,{id:"incorperate-hyper-parameters",children:"Incorperate hyper-parameters"}),"\n",(0,t.jsx)(n.h4,{id:"check-variable-readout",children:"Check variable readout"}),"\n",(0,t.jsx)(n.h4,{id:"delayed-observation",children:"Delayed observation"})]})}function h(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},1151:(e,n,r)=>{r.d(n,{Z:()=>l,a:()=>s});var t=r(7294);const i={},a=t.createContext(i);function s(e){const n=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.5efd8ecf.js b/assets/js/runtime~main.4c826219.js similarity index 96% rename from assets/js/runtime~main.5efd8ecf.js rename to assets/js/runtime~main.4c826219.js index 1a4b84c..ec93f77 100644 --- a/assets/js/runtime~main.5efd8ecf.js +++ b/assets/js/runtime~main.4c826219.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,r,t,c,d={},f={};function o(e){var a=f[e];if(void 0!==a)return a.exports;var r=f[e]={exports:{}};return d[e].call(r.exports,r,r.exports,o),r.exports}o.m=d,e=[],o.O=(a,r,t,c)=>{if(!r){var d=1/0;for(i=0;i=c)&&Object.keys(o.O).every((e=>o.O[e](r[b])))?r.splice(b--,1):(f=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[r,t,c]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a:a}),a},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var d={};a=a||[null,r({}),r([]),r(r)];for(var f=2&t&&e;"object"==typeof f&&!~a.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,o.d(c,d),c},o.d=(e,a)=>{for(var r in a)o.o(a,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,r)=>(o.f[r](e,a),a)),[])),o.u=e=>"assets/js/"+({53:"935f2afb",104:"db84cbea",152:"54f44165",402:"7eca3fad",433:"5df9459b",1047:"27768928",1276:"e689722c",1742:"8aba13c5",2197:"a82943a8",2535:"814f3328",2586:"0ae9fee1",2868:"50c67dcd",3061:"5e2ad779",3089:"a6aa9e1f",3469:"011ad09a",3608:"9e4087bc",3653:"67b9383b",4013:"01a85c17",4195:"c4f5d8e4",4368:"a94703ab",4618:"72b80372",4711:"de4738af",4918:"7205f4c0",4965:"b171606d",5131:"319c7a11",5288:"a2b18811",5489:"2a19b374",6075:"6d4920cb",6103:"ccc49370",7570:"d418963f",7918:"17896441",7920:"1a4e3797",7972:"b17e6dab",8324:"ba167612",8518:"a7bd4aaa",8610:"6875c492",8950:"d2e50428",8978:"c7e3ca8c",9214:"7a8ea9cb",9249:"13db8233",9280:"2d3c34e0",9659:"e3ae7939",9661:"5e95c892",9671:"0e384e19",9775:"e5f63c12",9782:"60ab8cc8"}[e]||e)+"."+{53:"21f1c8ba",104:"4c01c944",130:"41492cfe",152:"df1beff0",402:"d67c045f",433:"a48c9d1e",585:"621c4878",1047:"f3615a5f",1276:"62a3b612",1426:"5ed131ce",1742:"6500e87e",1772:"3b3ffedd",2197:"a81fb8e9",2535:"4d90e407",2586:"dfe83ad2",2868:"d1b3f3f5",3061:"4c87342d",3089:"3911efc9",3469:"54f14149",3608:"a0fa82ed",3653:"1aeaef53",4013:"45c8bbcc",4195:"919f0a8a",4368:"f95f521c",4618:"42a84c58",4711:"348482c8",4918:"386d8320",4965:"247e1dc3",5131:"cfd9b6e1",5288:"7c94ebd8",5489:"f44e7c52",6075:"75456c26",6103:"b52f7228",6945:"6ebd72f5",7570:"ebe25cfd",7874:"eddf33fa",7918:"0e14bb7a",7920:"aaeae7bb",7972:"df7c38ae",8324:"c8eb900c",8518:"6383a821",8610:"92c1c835",8894:"99777219",8950:"1effed08",8978:"88408eab",9214:"b1b25408",9249:"b1123138",9280:"e0db7b2d",9659:"91d124b5",9661:"802d41f7",9671:"cb465243",9775:"7cbdbf0e",9782:"1dc2123a"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t={},c="badger-home:",o.l=(e,a,r,d)=>{if(t[e])t[e].push(a);else{var f,b;if(void 0!==r)for(var n=document.getElementsByTagName("script"),i=0;i{f.onerror=f.onload=null,clearTimeout(s);var c=t[e];if(delete t[e],f.parentNode&&f.parentNode.removeChild(f),c&&c.forEach((e=>e(r))),a)return a(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=l.bind(null,f.onerror),f.onload=l.bind(null,f.onload),b&&document.head.appendChild(f)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/Badger/",o.gca=function(e){return e={17896441:"7918",27768928:"1047","935f2afb":"53",db84cbea:"104","54f44165":"152","7eca3fad":"402","5df9459b":"433",e689722c:"1276","8aba13c5":"1742",a82943a8:"2197","814f3328":"2535","0ae9fee1":"2586","50c67dcd":"2868","5e2ad779":"3061",a6aa9e1f:"3089","011ad09a":"3469","9e4087bc":"3608","67b9383b":"3653","01a85c17":"4013",c4f5d8e4:"4195",a94703ab:"4368","72b80372":"4618",de4738af:"4711","7205f4c0":"4918",b171606d:"4965","319c7a11":"5131",a2b18811:"5288","2a19b374":"5489","6d4920cb":"6075",ccc49370:"6103",d418963f:"7570","1a4e3797":"7920",b17e6dab:"7972",ba167612:"8324",a7bd4aaa:"8518","6875c492":"8610",d2e50428:"8950",c7e3ca8c:"8978","7a8ea9cb":"9214","13db8233":"9249","2d3c34e0":"9280",e3ae7939:"9659","5e95c892":"9661","0e384e19":"9671",e5f63c12:"9775","60ab8cc8":"9782"}[e]||e,o.p+o.u(e)},(()=>{var e={1303:0,532:0};o.f.j=(a,r)=>{var t=o.o(e,a)?e[a]:void 0;if(0!==t)if(t)r.push(t[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var c=new Promise(((r,c)=>t=e[a]=[r,c]));r.push(t[2]=c);var d=o.p+o.u(a),f=new Error;o.l(d,(r=>{if(o.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var c=r&&("load"===r.type?"missing":r.type),d=r&&r.target&&r.target.src;f.message="Loading chunk "+a+" failed.\n("+c+": "+d+")",f.name="ChunkLoadError",f.type=c,f.request=d,t[1](f)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,r)=>{var t,c,d=r[0],f=r[1],b=r[2],n=0;if(d.some((a=>0!==e[a]))){for(t in f)o.o(f,t)&&(o.m[t]=f[t]);if(b)var i=b(o)}for(a&&a(r);n{"use strict";var e,a,r,t,c,d={},f={};function o(e){var a=f[e];if(void 0!==a)return a.exports;var r=f[e]={exports:{}};return d[e].call(r.exports,r,r.exports,o),r.exports}o.m=d,e=[],o.O=(a,r,t,c)=>{if(!r){var d=1/0;for(i=0;i=c)&&Object.keys(o.O).every((e=>o.O[e](r[b])))?r.splice(b--,1):(f=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[r,t,c]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a:a}),a},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var d={};a=a||[null,r({}),r([]),r(r)];for(var f=2&t&&e;"object"==typeof f&&!~a.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,o.d(c,d),c},o.d=(e,a)=>{for(var r in a)o.o(a,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,r)=>(o.f[r](e,a),a)),[])),o.u=e=>"assets/js/"+({53:"935f2afb",104:"db84cbea",152:"54f44165",402:"7eca3fad",433:"5df9459b",1047:"27768928",1276:"e689722c",1742:"8aba13c5",2197:"a82943a8",2535:"814f3328",2586:"0ae9fee1",2868:"50c67dcd",3061:"5e2ad779",3089:"a6aa9e1f",3469:"011ad09a",3608:"9e4087bc",3653:"67b9383b",4013:"01a85c17",4195:"c4f5d8e4",4368:"a94703ab",4618:"72b80372",4711:"de4738af",4918:"7205f4c0",4965:"b171606d",5131:"319c7a11",5288:"a2b18811",5489:"2a19b374",6075:"6d4920cb",6103:"ccc49370",7570:"d418963f",7918:"17896441",7920:"1a4e3797",7972:"b17e6dab",8324:"ba167612",8518:"a7bd4aaa",8610:"6875c492",8950:"d2e50428",8978:"c7e3ca8c",9214:"7a8ea9cb",9249:"13db8233",9280:"2d3c34e0",9659:"e3ae7939",9661:"5e95c892",9671:"0e384e19",9775:"e5f63c12",9782:"60ab8cc8"}[e]||e)+"."+{53:"3f9257d2",104:"4c01c944",130:"41492cfe",152:"df1beff0",402:"d67c045f",433:"a48c9d1e",585:"621c4878",1047:"f3615a5f",1276:"62a3b612",1426:"5ed131ce",1742:"6500e87e",1772:"3b3ffedd",2197:"a81fb8e9",2535:"4d90e407",2586:"dfe83ad2",2868:"d1b3f3f5",3061:"ec0e2f8b",3089:"3911efc9",3469:"54f14149",3608:"a0fa82ed",3653:"1aeaef53",4013:"45c8bbcc",4195:"919f0a8a",4368:"f95f521c",4618:"42a84c58",4711:"348482c8",4918:"386d8320",4965:"247e1dc3",5131:"cfd9b6e1",5288:"7c94ebd8",5489:"f44e7c52",6075:"75456c26",6103:"b52f7228",6945:"6ebd72f5",7570:"ebe25cfd",7874:"eddf33fa",7918:"0e14bb7a",7920:"aaeae7bb",7972:"df7c38ae",8324:"c8eb900c",8518:"6383a821",8610:"92c1c835",8894:"99777219",8950:"1effed08",8978:"8350ae29",9214:"b1b25408",9249:"b1123138",9280:"e0db7b2d",9659:"91d124b5",9661:"802d41f7",9671:"cb465243",9775:"7cbdbf0e",9782:"1dc2123a"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t={},c="badger-home:",o.l=(e,a,r,d)=>{if(t[e])t[e].push(a);else{var f,b;if(void 0!==r)for(var n=document.getElementsByTagName("script"),i=0;i{f.onerror=f.onload=null,clearTimeout(s);var c=t[e];if(delete t[e],f.parentNode&&f.parentNode.removeChild(f),c&&c.forEach((e=>e(r))),a)return a(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=l.bind(null,f.onerror),f.onload=l.bind(null,f.onload),b&&document.head.appendChild(f)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/Badger/",o.gca=function(e){return e={17896441:"7918",27768928:"1047","935f2afb":"53",db84cbea:"104","54f44165":"152","7eca3fad":"402","5df9459b":"433",e689722c:"1276","8aba13c5":"1742",a82943a8:"2197","814f3328":"2535","0ae9fee1":"2586","50c67dcd":"2868","5e2ad779":"3061",a6aa9e1f:"3089","011ad09a":"3469","9e4087bc":"3608","67b9383b":"3653","01a85c17":"4013",c4f5d8e4:"4195",a94703ab:"4368","72b80372":"4618",de4738af:"4711","7205f4c0":"4918",b171606d:"4965","319c7a11":"5131",a2b18811:"5288","2a19b374":"5489","6d4920cb":"6075",ccc49370:"6103",d418963f:"7570","1a4e3797":"7920",b17e6dab:"7972",ba167612:"8324",a7bd4aaa:"8518","6875c492":"8610",d2e50428:"8950",c7e3ca8c:"8978","7a8ea9cb":"9214","13db8233":"9249","2d3c34e0":"9280",e3ae7939:"9659","5e95c892":"9661","0e384e19":"9671",e5f63c12:"9775","60ab8cc8":"9782"}[e]||e,o.p+o.u(e)},(()=>{var e={1303:0,532:0};o.f.j=(a,r)=>{var t=o.o(e,a)?e[a]:void 0;if(0!==t)if(t)r.push(t[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var c=new Promise(((r,c)=>t=e[a]=[r,c]));r.push(t[2]=c);var d=o.p+o.u(a),f=new Error;o.l(d,(r=>{if(o.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var c=r&&("load"===r.type?"missing":r.type),d=r&&r.target&&r.target.src;f.message="Loading chunk "+a+" failed.\n("+c+": "+d+")",f.name="ChunkLoadError",f.type=c,f.request=d,t[1](f)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,r)=>{var t,c,d=r[0],f=r[1],b=r[2],n=0;if(d.some((a=>0!==e[a]))){for(t in f)o.o(f,t)&&(o.m[t]=f[t]);if(b)var i=b(o)}for(a&&a(r);n