Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
f0da14822efbfcabd1e13c56964ea280611bd782
[simgrid.git] / src / bindings / java / org / simgrid / surf / Model.java
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 2.0.12
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8
9 package org.simgrid.surf;
10
11 /**
12   * A component (e.g., Cpu, Network, Storage, ...) is composed of three classes:
13   * <ul>
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>
17   * </ul>
18   * @see Resource
19   * @see Action
20   */
21 public class Model {
22   private long swigCPtr;
23   protected boolean swigCMemOwn;
24
25   protected Model(long cPtr, boolean cMemoryOwn) {
26     swigCMemOwn = cMemoryOwn;
27     swigCPtr = cPtr;
28   }
29
30   protected static long getCPtr(Model obj) {
31     return (obj == null) ? 0 : obj.swigCPtr;
32   }
33
34   protected void finalize() {
35     delete();
36   }
37
38   public synchronized void delete() {
39     if (swigCPtr != 0) {
40       if (swigCMemOwn) {
41         swigCMemOwn = false;
42         SurfJNI.delete_Model(swigCPtr);
43       }
44       swigCPtr = 0;
45     }
46   }
47
48   
49   /**
50     * @return The name of the model
51     */
52   public String getName() {
53     return SurfJNI.Model_getName(swigCPtr, this);
54   }
55
56   
57   /**
58     * Share the resources between the actions
59     * @param now the current time
60     * @return the date of the next action of the model will finish
61     */
62   public double shareResources(double now) {
63     return SurfJNI.Model_shareResources(swigCPtr, this, now);
64   }
65
66   public double shareResourcesLazy(double now) {
67     return SurfJNI.Model_shareResourcesLazy(swigCPtr, this, now);
68   }
69
70   public double shareResourcesFull(double now) {
71     return SurfJNI.Model_shareResourcesFull(swigCPtr, this, now);
72   }
73
74   
75   /**
76     * Update time of actions and eventually their states
77     * @param now the new current time
78     * @param delta the delta between previous and new current time
79     */
80   public void updateActionsState(double now, double delta) {
81     SurfJNI.Model_updateActionsState(swigCPtr, this, now, delta);
82   }
83
84   public void updateActionsStateLazy(double now, double delta) {
85     SurfJNI.Model_updateActionsStateLazy(swigCPtr, this, now, delta);
86   }
87
88   public void updateActionsStateFull(double now, double delta) {
89     SurfJNI.Model_updateActionsStateFull(swigCPtr, this, now, delta);
90   }
91
92   
93   /**
94     * Get the List of running Actions
95     */
96   public ActionList getRunningActionSet() {
97     long cPtr = SurfJNI.Model_getRunningActionSet(swigCPtr, this);
98     return (cPtr == 0) ? null : new ActionList(cPtr, false);
99   }
100
101   public void addTraces() {
102     SurfJNI.Model_addTraces(swigCPtr, this);
103   }
104
105 }