Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
actually kill models' names
[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     * Share the resources between the actions
51     * @param now the current time
52     * @return the date of the next action of the model will finish
53     */
54   public double shareResources(double now) {
55     return SurfJNI.Model_shareResources(swigCPtr, this, now);
56   }
57
58   public double shareResourcesLazy(double now) {
59     return SurfJNI.Model_shareResourcesLazy(swigCPtr, this, now);
60   }
61
62   public double shareResourcesFull(double now) {
63     return SurfJNI.Model_shareResourcesFull(swigCPtr, this, now);
64   }
65
66   
67   /**
68     * Update time of actions and eventually their states
69     * @param now the new current time
70     * @param delta the delta between previous and new current time
71     */
72   public void updateActionsState(double now, double delta) {
73     SurfJNI.Model_updateActionsState(swigCPtr, this, now, delta);
74   }
75
76   public void updateActionsStateLazy(double now, double delta) {
77     SurfJNI.Model_updateActionsStateLazy(swigCPtr, this, now, delta);
78   }
79
80   public void updateActionsStateFull(double now, double delta) {
81     SurfJNI.Model_updateActionsStateFull(swigCPtr, this, now, delta);
82   }
83
84   
85   /**
86     * Get the List of running Actions
87     */
88   public ActionList getRunningActionSet() {
89     long cPtr = SurfJNI.Model_getRunningActionSet(swigCPtr, this);
90     return (cPtr == 0) ? null : new ActionList(cPtr, false);
91   }
92
93   public void addTraces() {
94     SurfJNI.Model_addTraces(swigCPtr, this);
95   }
96
97 }