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 component (e.g., Cpu, Network, Storage, ...) is composed of three classes:
14 * <li> Model: It handle the interactions between resoucses and actions</li>
15 * <li> Resource: A resource used by the model (e.g., a cpu, a network link)</li>
16 * <li> Action: An action generated by the resources (e.g., execution, communication)</li>
22 private long swigCPtr;
23 protected boolean swigCMemOwn;
25 protected Model(long cPtr, boolean cMemoryOwn) {
26 swigCMemOwn = cMemoryOwn;
30 protected static long getCPtr(Model obj) {
31 return (obj == null) ? 0 : obj.swigCPtr;
34 protected void finalize() {
38 public synchronized void delete() {
42 SurfJNI.delete_Model(swigCPtr);
51 * @param name The name of the model
53 public Model(String name) {
54 this(SurfJNI.new_Model(name), true);
59 * @return The name of the model
61 public String getName() {
62 return SurfJNI.Model_getName(swigCPtr, this);
67 * Share the resources between the actions
68 * @param now the current time
69 * @return the date of the next action of the model will finish
71 public double shareResources(double now) {
72 return SurfJNI.Model_shareResources(swigCPtr, this, now);
75 public double shareResourcesLazy(double now) {
76 return SurfJNI.Model_shareResourcesLazy(swigCPtr, this, now);
79 public double shareResourcesFull(double now) {
80 return SurfJNI.Model_shareResourcesFull(swigCPtr, this, now);
85 * Update time of actions and eventually their states
86 * @param now the new current time
87 * @param delta the delta between previous and new current time
89 public void updateActionsState(double now, double delta) {
90 SurfJNI.Model_updateActionsState(swigCPtr, this, now, delta);
93 public void updateActionsStateLazy(double now, double delta) {
94 SurfJNI.Model_updateActionsStateLazy(swigCPtr, this, now, delta);
97 public void updateActionsStateFull(double now, double delta) {
98 SurfJNI.Model_updateActionsStateFull(swigCPtr, this, now, delta);
103 * Get the List of running Actions
105 public ActionList getRunningActionSet() {
106 long cPtr = SurfJNI.Model_getRunningActionSet(swigCPtr, this);
107 return (cPtr == 0) ? null : new ActionList(cPtr, false);