Class AbstractModel

Class Documentation

class AbstractModel

Base class representing a model available to the AMS system.

An AbstractModel stores the filesystem path to the model and a version number. It does not define loading or execution semantics; those are handled by derived ‘concrete’ classes or by the

The model path may come either from a JSON description (containing "model_path") or from an explicit string constructor.

Public Types

using Json = nlohmann::json
using Path = std::filesystem::path

Public Functions

explicit AbstractModel(std::string modelPath, std::optional<std::string> Name = std::nullopt, int Version = 0)

Construct a model from an explicit path and version number.

The modelPath string is converted into a filesystem::path. If the provided string is empty, the internal path is left empty.

explicit AbstractModel(const Json &value)

Construct a model from a JSON object.

Expects a "model_path" field if the model specifies one and optionally a "model_name" providing an identifier to the model

inline const Path &getPath() const

Returns the filesystem path associated with the model.

inline const std::optional<std::string> &getName() const

Returns the filesystem path associated with the model.

inline int getVersion() const

Returns the model version identifier.

void info() const

Print model information to stdout.

Primarily useful for debugging or logging.