AdaStress.AdaStressModule

Adaptive stress testing (AST) package. Finds and analyzes likeliest failures for a simulated system under test. See documentation for usage.

AdaStress.cleanMethod
clean()

Forcibly remove temporary environment, purging all enabled submodules. Only necessary if submodule manager is corrupted and disable cannot restore functionality. Takes effect after Julia restart.

AdaStress.disableMethod
disable(submodule)

Disable submodule(s). Accepts string or vector of strings. With zero arguments defaults to all enabled submodules. Takes effect after Julia restart.

AdaStress.enableMethod
enable(submodule)

Enable submodule(s). Accepts string or vector of strings. With zero arguments defaults to all associated submodules. Takes effect immediately.

AdaStress.excludeMethod
exclude(dir::String)

Associate package directory to main package via submodule table instead of direct code loading. Equivalent of include for submodules / optional dependencies.

AdaStress.loadMethod
load()

Load enabled submodules (necessary after Julia restart). Takes effect immediately.

AdaStress.InterfaceModule

Interface between custom simulation and AST framework. Supports various levels of observability and access.

AdaStress.Interface.ASTMDPType

Standard MDP object for AST. Wraps simulation and contains auxiliary information and parameters.

AdaStress.Interface.ASTMDPMethod
ASTMDP(sim::AbstractSimulation; kwargs...)

Constructor for ASTMDP object. Infers various properties of MDP. Allows kwargs to be specified flatly and automatically assigns to correct level.

AdaStress.Interface.AbstractCoreObjectiveType

AST core objective function abstract type. Defines fundamental reward function by combining log probability, event bonus, and distance heuristic. Additional contributions to the reward should be added by implementing reward function in GrayBox or BlackBox interface.

AdaStress.Interface.AbstractDistanceHeuristicType

Distance heuristic abstract type. Custom heuristics inherit this type and implement reset! and apply! functions. Application can return scalar value or partially-applied function transforming f(s,s') to f(s)(s').

AdaStress.Interface.FinalHeuristicType

Final distance encountered. If MDP is episodic, this is equal to the minimum distance (determined retroactively instead of accumulated as in MinimumHeuristic).

AdaStress.Interface.FunctoidType

Conditional function. Applies function if applicable, otherwise returns value. Useful for conditional partial function application.

AdaStress.Interface.RemoteASTMDPType
RemoteASTMDP{S<:State, A<:Action} <: AbstractASTMDP{S, A}

MDP object that virtually references remote MDP. Autogenerated by ASTClient.

AdaStress.Interface.TokenType

Optional private token for additional security. Use of token prompts seed rehashing to obstruct client-side interpretability.

AdaStress.Interface.callMethod

Perform function call on server MDP. Call sends request to server with provided function and arguments and receives return value. Blocks until complete.

AdaStress.Interface.connect!Method
connect!(client::ASTClient; remote::String="", remote_port::Int64=1812)

Connect client to server, optionally through SSH tunnel. Optional keyword argument remote should be of the form user@machine.

AdaStress.Interface.connect!Method
connect!(server::ASTServer; remote::String="", remote_port::Int64=1812)

Connect server, optionally through SSH tunnel. Optional keyword argument remote should be of the form user@machine.

AdaStress.Interface.distanceMethod
distance(sim::BlackBox)

Return custom metric of distance to event. For best results, metric should depend only on current state. For episodic simulation, return minimum distance to event across entire episode (miss distance).

AdaStress.Interface.distanceMethod
distance(sim::GrayBox)

Return custom metric of distance to event. For best results, metric should depend only on current state. For episodic simulation, return minimum distance to event across entire episode (miss distance).

AdaStress.Interface.environmentMethod
environment(sim::GrayBox)

Return Environment object constructed by simulation. Environment is an alias of Dict{Symbol, Sampleable}.

AdaStress.Interface.generate_mdpMethod
generate_mdp(client::ASTClient)

Query remote MDP and generate RemoteASTMDP with matching attributes to interface with appropriate solvers.

AdaStress.Interface.iseventMethod

isevent(sim::BlackBox)

Check whether simulation is in event (failure) state. For episodic simulation, check whether event occurred during episode.

AdaStress.Interface.iseventMethod

isevent(sim::GrayBox)

Check whether simulation is in event (failure) state. For episodic simulation, check whether event occurred during episode.

AdaStress.Interface.isterminalMethod
isterminal(sim::BlackBox)

Check whether simulation has finished due to time limit or terminal state, independent of failure status.

AdaStress.Interface.isterminalMethod
isterminal(sim::GrayBox)

Check whether simulation has finished due to time limit or terminal state, independent of failure status.

AdaStress.Interface.observeMethod
observe(sim::BlackBox)

Return quasi-normalized observation of simulation. Observation should copy, not reference, simulation state. If simulation is unobservable, leave unimplemented.

AdaStress.Interface.observeMethod
observe(sim::GrayBox)

Return quasi-normalized observation of simulation. Observation should copy, not reference, simulation state. If simulation is unobservable, leave unimplemented.

AdaStress.Interface.pingMethod
ping(client::ASTClient)

Request empty echo from ASTServer, returning approximate round-trip time in seconds.

AdaStress.Interface.rewardMethod
reward(sim::BlackBox)

Advanced option: additional reward or heuristic. Returns scalar value or partially-applied function, allowing efficient calculation of R(s,s') = R(s)(s'). Should not alter simulation. See documentation for more details.

AdaStress.Interface.rewardMethod
reward(sim::GrayBox, x::EnvironmentValue)

Advanced option: additional reward or heuristic. Returns scalar value or partially-applied function, allowing efficient calculation of R(s,a,s') = R(s,a)(s'). Should not alter simulation. See documentation for more details.

AdaStress.Interface.runMethod

Listen for incoming requests and execute function calls on MDP. Can handle multiple client connections asynchronously, but server currently holds a single MDP instance.

AdaStress.Interface.set_passwordMethod
set_password(server::ASTServer)

Set private token to string input (password). Avoids explicit representation of password in storage or side effects.

AdaStress.Interface.set_tokenMethod
set_token(server::ASTServer, token)

Set private token to encrypt seeds. Recommended to use set_password instead, to avoid leaking token through side effects.

AdaStress.Interface.step!Method
step([rng::AbstractRNG], sim::BlackBox)

Step simulation and return log probability of transition. If simulation uses global RNG, the one-argument step! should be implemented. If simulation requires non-global RNG, the two-argument function should be implemented instead.

AdaStress.Interface.step!Method
step(sim::GrayBox, x::EnvironmentValue)

Step simulation given an EnvironmentValue object. EnvironmentValue is an alias of Dict{Symbol, Any}.

AdaStress.Interface.syncMethod

Read from socket until communication is synchronized. Typically unnecessary, but mitigates issue in which IO between client and server can become mismatched.

AdaStress.Interface.unflattenMethod
unflatten(distribution, array::AbstractVector{<:Real})

Reconstruct environment variable from quasi-normalized array.

Base.randMethod

Sample environment, returning EnvironmentValue (default) or array.

AdaStress.AnalysisModule

Analysis framework. Provides utilities to analyze and visualize solver results.

AdaStress.Solvers.MonteCarloSearchModule

Simple uninformed Monte Carlo search. Should be used as a baseline for other local solvers, in terms of runtime performance and overall efficacy.

AdaStress.SolversModule

Solvers module. Provides algorithms for solving AST MDPs.

DataStructures.enqueue!Method

Delete least significant keys if length exceeds k. Facilitates top-k priority queueing.

AdaStress.Solvers.MonteCarloTreeSearchModule

Monte Carlo tree search algorithm. Balances exploration and experience. Constructs partially-ordered search tree over actions, treating states as anonymous.

AdaStress.Solvers.MonteCarloTreeSearch.addMethod

Take an action from a given state, adding and returning new child. For transient action chains, such as rollouts, set forward link to false; nodes are deleted automatically by garbage collector when leaf goes out of scope.