Class: Lemans::Bench::Agent
Overview
The agent section: who works the task and under what budget.
Constant Summary collapse
- VALIDATED =
%i[name version model timeout_sec step_limit cost_limit exec_timeout_sec config models network].freeze
Instance Method Summary collapse
- #config ⇒ Object
- #cost_limit ⇒ Object
- #exec_timeout_sec ⇒ Object
-
#initialize(config) ⇒ Agent
constructor
A new instance of Agent.
- #model ⇒ Object
-
#models ⇒ Object
modeltakes one name or a list; a list turns the run into a sweep, one full grid per model. - #name ⇒ Object
-
#network ⇒ Object
The only environment knob the agent phase owns:
agent.environment.network. - #step_limit ⇒ Object
- #timeout_sec ⇒ Object
- #version ⇒ Object
Methods inherited from Section
Constructor Details
#initialize(config) ⇒ Agent
Returns a new instance of Agent.
144 |
# File 'lib/lemans/bench.rb', line 144 def initialize(config) = super(config, "agent") |
Instance Method Details
#config ⇒ Object
153 |
# File 'lib/lemans/bench.rb', line 153 def config = (self["config"] || {}).freeze |
#cost_limit ⇒ Object
151 |
# File 'lib/lemans/bench.rb', line 151 def cost_limit = float("cost_limit") |
#exec_timeout_sec ⇒ Object
152 |
# File 'lib/lemans/bench.rb', line 152 def exec_timeout_sec = seconds("exec_timeout", default: 30) |
#model ⇒ Object
148 |
# File 'lib/lemans/bench.rb', line 148 def model = models.first |
#models ⇒ Object
model takes one name or a list; a list turns the run into a sweep, one full grid per model.
156 |
# File 'lib/lemans/bench.rb', line 156 def models = Array(self["model"]).map(&:to_s).freeze |
#name ⇒ Object
146 |
# File 'lib/lemans/bench.rb', line 146 def name = fetch("name") |
#network ⇒ Object
The only environment knob the agent phase owns: agent.environment.network.
159 160 161 |
# File 'lib/lemans/bench.rb', line 159 def network NetworkPolicy.from_config((self["environment"] || {})["network"], field: dotted("environment.network")) end |
#step_limit ⇒ Object
150 |
# File 'lib/lemans/bench.rb', line 150 def step_limit = integer("step_limit") || 0 |
#timeout_sec ⇒ Object
149 |
# File 'lib/lemans/bench.rb', line 149 def timeout_sec = seconds("timeout", default: "30m") |
#version ⇒ Object
147 |
# File 'lib/lemans/bench.rb', line 147 def version = self["version"]&.to_s |