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 * An action created by a Resource (e.g., a communication, an execution)
17 private long swigCPtr;
18 protected boolean swigCMemOwn;
20 protected Action(long cPtr, boolean cMemoryOwn) {
21 swigCMemOwn = cMemoryOwn;
25 protected static long getCPtr(Action obj) {
26 return (obj == null) ? 0 : obj.swigCPtr;
29 protected void finalize() {
33 public synchronized void delete() {
37 SurfJNI.delete_Action(swigCPtr);
43 protected static long[] cArrayUnwrap(Action[] arrayWrapper) {
44 long[] cArray = new long[arrayWrapper.length];
45 for (int i=0; i<arrayWrapper.length; i++)
46 cArray[i] = Action.getCPtr(arrayWrapper[i]);
50 protected static Action[] cArrayWrap(long[] cArray, boolean cMemoryOwn) {
51 Action[] arrayWrapper = new Action[cArray.length];
52 for (int i=0; i<cArray.length; i++)
53 arrayWrapper[i] = new Action(cArray[i], cMemoryOwn);
60 * @param model The model associated
61 * @param cost The cost of the action (e.g., flops, bytes)
62 * @param failed If the action has failed
64 public Action(Model model, double cost, boolean failed) {
65 this(SurfJNI.new_Action(Model.getCPtr(model), model, cost, failed), true);
70 * @return The model associated
72 public Model getModel() {
73 long cPtr = SurfJNI.Action_getModel(swigCPtr, this);
74 return (cPtr == 0) ? null : new Model(cPtr, false);
79 * @return The variable associatied (if using LMM)
81 public LmmVariable getVariable() {
82 long cPtr = SurfJNI.Action_getVariable(swigCPtr, this);
83 return (cPtr == 0) ? null : new LmmVariable(cPtr, false);
88 * @return The state of the action
90 public ActionState getState() {
91 return ActionState.swigToEnum(SurfJNI.Action_getState(swigCPtr, this));
96 * @return True if suspended
98 public boolean isSuspended() {
99 return SurfJNI.Action_isSuspended(swigCPtr, this);
106 public double getBound() {
107 return SurfJNI.Action_getBound(swigCPtr, this);
114 public void setBound(double bound) {
115 SurfJNI.Action_setBound(swigCPtr, this, bound);
120 * Update remaining amount of cost to do
121 * @param delta Difference of time since last call to this function
123 public void updateRemains(double delta) {
124 SurfJNI.Action_updateRemains(swigCPtr, this, delta);
129 * @return The remaining amount of cost to do
131 public double getRemains() {
132 return SurfJNI.Action_getRemains(swigCPtr, this);
137 * @param The new priority of the action
139 public void setPriority(double priority) {
140 SurfJNI.Action_setPriority(swigCPtr, this, priority);
145 * @param The new state
147 public void setState(ActionState state) {
148 SurfJNI.Action_setState(swigCPtr, this, state.swigValue());