1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
5 * Do not make changes to this file unless you know what you are doing--modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
9 package org.simgrid.surf;
12 * A resource used by a model (e.g., a cpu, a network link)
16 public class Resource {
17 private long swigCPtr;
18 protected boolean swigCMemOwn;
20 protected Resource(long cPtr, boolean cMemoryOwn) {
21 swigCMemOwn = cMemoryOwn;
25 protected static long getCPtr(Resource obj) {
26 return (obj == null) ? 0 : obj.swigCPtr;
29 protected void finalize() {
33 public synchronized void delete() {
37 SurfJNI.delete_Resource(swigCPtr);
45 * @return The name of the resource
47 public String getName() {
48 return SurfJNI.Resource_getName(swigCPtr, this);
53 * @return True if the Resource is used
55 public boolean isUsed() {
56 return SurfJNI.Resource_isUsed(swigCPtr, this);
61 * @return The model associated to this Resource
63 public Model getModel() {
64 long cPtr = SurfJNI.Resource_getModel(swigCPtr, this);
65 return (cPtr == 0) ? null : new Model(cPtr, false);
70 * @return The state of the resource
73 public ResourceState getState() {
74 return ResourceState.swigToEnum(SurfJNI.Resource_getState(swigCPtr, this));
79 * @return The constraint associatied (if using LMM)
81 public LmmConstraint getConstraint() {
82 long cPtr = SurfJNI.Resource_getConstraint(swigCPtr, this);
83 return (cPtr == 0) ? null : new LmmConstraint(cPtr, false);
88 * @return The XbtDict of properties associated to this Resource
90 public XbtDict getProperties() {
91 long cPtr = SurfJNI.Resource_getProperties(swigCPtr, this);
92 return (cPtr == 0) ? null : new XbtDict(cPtr, false);
97 * Update the state of the Resource
102 public void updateState(TmgrTraceEvent event_type, double value, double date) {
103 SurfJNI.Resource_updateState(swigCPtr, this, TmgrTraceEvent.getCPtr(event_type), event_type, value, date);