-protected:
- struct Metric {
- double peak; /**< The peak of the metric, ie its max value */
- double scale; /**< Current availability of the metric according to the traces, in [0,1] */
- tmgr_trace_event_t event; /**< The associated trace event associated to the metric */
- };
+ AnyResource* set_constraint(lmm::Constraint* constraint)
+ {
+ constraint_ = constraint;
+ return static_cast<AnyResource*>(this);
+ }
+
+ lmm::Constraint* get_constraint() const { return constraint_; }
+
+ /** @brief Set the concurrency limit for this resource */
+ virtual void set_concurrency_limit(int limit) const
+ {
+ if (limit != -1)
+ get_constraint()->reset_concurrency_maximum();
+ get_constraint()->set_concurrency_limit(limit);
+ }
+
+ /** @brief Get the concurrency limit of this resource */
+ virtual int get_concurrency_limit() const { return get_constraint()->get_concurrency_limit(); }
+
+ /** @brief returns the current load due to activities (in flops per second, byte per second or similar)
+ *
+ * The load due to external usages modeled by profile files is ignored.*/
+ virtual double get_load() const { return constraint_->get_load(); }
+
+ bool is_used() const override { return model_->get_maxmin_system()->constraint_used(constraint_); }