/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.11
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.simgrid.surf;

import org.simgrid.NativeLib;

public class SurfJNI {

  static {
    NativeLib.nativeInit("surf-java");
    Runtime.getRuntime().addShutdownHook(
      new Thread() {
        public void run() {
          Thread.currentThread().setName( "Destroyer" );
          Surf.clean();
        }
      }
    );
  }

  public final static native long[] ActionList_getArray(long jarg1, ActionList jarg1_);
  public final static native long new_ActionList();
  public final static native void delete_ActionList(long jarg1);
  public final static native Object getAction(long jarg1);
  public final static native Object getCpuModelDirector(long jarg1);
  public final static native Object getCpuDirector(long jarg1);
  public final static native Object getCpuActionDirector(long jarg1);
  public final static native double getClock();
  public final static native void clean();
  public final static native long getCpuModel();
  public final static native void setCpuModel(long jarg1, CpuModel jarg1_);
  public final static native void setCpu(String jarg1, long jarg2, Cpu jarg2_);
  public final static native long[] getRoute(String jarg1, String jarg2);
  public final static native void delete_Plugin(long jarg1);
  public final static native void Plugin_activateCpuCreatedCallback(long jarg1, Plugin jarg1_);
  public final static native void Plugin_cpuCreatedCallback(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_);
  public final static native void Plugin_cpuCreatedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_);
  public final static native void Plugin_activateCpuDestructedCallback(long jarg1, Plugin jarg1_);
  public final static native void Plugin_cpuDestructedCallback(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_);
  public final static native void Plugin_cpuDestructedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_);
  public final static native void Plugin_activateCpuStateChangedCallback(long jarg1, Plugin jarg1_);
  public final static native void Plugin_cpuStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_, int jarg3, int jarg4);
  public final static native void Plugin_cpuStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, Cpu jarg2_, int jarg3, int jarg4);
  public final static native void Plugin_activateCpuActionStateChangedCallback(long jarg1, Plugin jarg1_);
  public final static native void Plugin_cpuActionStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, CpuAction jarg2_, int jarg3, int jarg4);
  public final static native void Plugin_cpuActionStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, CpuAction jarg2_, int jarg3, int jarg4);
  public final static native void Plugin_activateNetworkLinkCreatedCallback(long jarg1, Plugin jarg1_);
  public final static native void Plugin_networkLinkCreatedCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_);
  public final static native void Plugin_networkLinkCreatedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_);
  public final static native void Plugin_activateNetworkLinkDestructedCallback(long jarg1, Plugin jarg1_);
  public final static native void Plugin_networkLinkDestructedCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_);
  public final static native void Plugin_networkLinkDestructedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_);
  public final static native void Plugin_activateNetworkLinkStateChangedCallback(long jarg1, Plugin jarg1_);
  public final static native void Plugin_networkLinkStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_, int jarg3, int jarg4);
  public final static native void Plugin_networkLinkStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkLink jarg2_, int jarg3, int jarg4);
  public final static native void Plugin_activateNetworkActionStateChangedCallback(long jarg1, Plugin jarg1_);
  public final static native void Plugin_networkActionStateChangedCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, int jarg3, int jarg4);
  public final static native void Plugin_networkActionStateChangedCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, int jarg3, int jarg4);
  public final static native void Plugin_activateNetworkCommunicateCallback(long jarg1, Plugin jarg1_);
  public final static native void Plugin_networkCommunicateCallback(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, long jarg3, RoutingEdge jarg3_, long jarg4, RoutingEdge jarg4_, double jarg5, double jarg6);
  public final static native void Plugin_networkCommunicateCallbackSwigExplicitPlugin(long jarg1, Plugin jarg1_, long jarg2, NetworkAction jarg2_, long jarg3, RoutingEdge jarg3_, long jarg4, RoutingEdge jarg4_, double jarg5, double jarg6);
  public final static native long new_Plugin();
  public final static native void Plugin_director_connect(Plugin obj, long cptr, boolean mem_own, boolean weak_global);
  public final static native void Plugin_change_ownership(Plugin obj, long cptr, boolean take_or_release);
  public final static native void delete_TmgrTrace(long jarg1);
  public final static native long TmgrTraceEvent_getIdx(long jarg1, TmgrTraceEvent jarg1_);
  public final static native void delete_TmgrTraceEvent(long jarg1);
  public final static native String Model_getName(long jarg1, Model jarg1_);
  public final static native double Model_shareResources(long jarg1, Model jarg1_, double jarg2);
  public final static native double Model_shareResourcesLazy(long jarg1, Model jarg1_, double jarg2);
  public final static native double Model_shareResourcesFull(long jarg1, Model jarg1_, double jarg2);
  public final static native void Model_updateActionsState(long jarg1, Model jarg1_, double jarg2, double jarg3);
  public final static native void Model_updateActionsStateLazy(long jarg1, Model jarg1_, double jarg2, double jarg3);
  public final static native void Model_updateActionsStateFull(long jarg1, Model jarg1_, double jarg2, double jarg3);
  public final static native long Model_getRunningActionSet(long jarg1, Model jarg1_);
  public final static native void Model_addTraces(long jarg1, Model jarg1_);
  public final static native void delete_Model(long jarg1);
  public final static native long new_CpuModel(String jarg1);
  public final static native void delete_CpuModel(long jarg1);
  public final static native long CpuModel_createCpu(long jarg1, CpuModel jarg1_, String jarg2, double[] jarg3, int jarg4, double jarg5, long jarg6, TmgrTrace jarg6_, int jarg7, int jarg8, long jarg9, TmgrTrace jarg9_, long jarg10, XbtDict jarg10_);
  public final static native void CpuModel_director_connect(CpuModel obj, long cptr, boolean mem_own, boolean weak_global);
  public final static native void CpuModel_change_ownership(CpuModel obj, long cptr, boolean take_or_release);
  public final static native String Resource_getName(long jarg1, Resource jarg1_);
  public final static native boolean Resource_isUsed(long jarg1, Resource jarg1_);
  public final static native long Resource_getModel(long jarg1, Resource jarg1_);
  public final static native int Resource_getState(long jarg1, Resource jarg1_);
  public final static native long Resource_getConstraint(long jarg1, Resource jarg1_);
  public final static native long Resource_getProperties(long jarg1, Resource jarg1_);
  public final static native void Resource_updateState(long jarg1, Resource jarg1_, long jarg2, TmgrTraceEvent jarg2_, double jarg3, double jarg4);
  public final static native void delete_Resource(long jarg1);
  public final static native long new_Cpu__SWIG_0(long jarg1, Model jarg1_, String jarg2, long jarg3, XbtDict jarg3_, long jarg4, LmmConstraint jarg4_, int jarg5, double jarg6, double jarg7);
  public final static native long new_Cpu__SWIG_1(long jarg1, Model jarg1_, String jarg2, long jarg3, XbtDict jarg3_, int jarg4, double jarg5, double jarg6);
  public final static native void delete_Cpu(long jarg1);
  public final static native double Cpu_getCurrentPowerPeak(long jarg1, Cpu jarg1_);
  public final static native double Cpu_getCurrentPowerPeakSwigExplicitCpu(long jarg1, Cpu jarg1_);
  public final static native long Cpu_execute(long jarg1, Cpu jarg1_, double jarg2);
  public final static native long Cpu_sleep(long jarg1, Cpu jarg1_, double jarg2);
  public final static native int Cpu_getCore(long jarg1, Cpu jarg1_);
  public final static native int Cpu_getCoreSwigExplicitCpu(long jarg1, Cpu jarg1_);
  public final static native double Cpu_getSpeed(long jarg1, Cpu jarg1_, double jarg2);
  public final static native double Cpu_getSpeedSwigExplicitCpu(long jarg1, Cpu jarg1_, double jarg2);
  public final static native double Cpu_getAvailableSpeed(long jarg1, Cpu jarg1_);
  public final static native double Cpu_getAvailableSpeedSwigExplicitCpu(long jarg1, Cpu jarg1_);
  public final static native double Cpu_getPowerPeakAt(long jarg1, Cpu jarg1_, int jarg2);
  public final static native int Cpu_getNbPstates(long jarg1, Cpu jarg1_);
  public final static native void Cpu_setPowerPeakAt(long jarg1, Cpu jarg1_, int jarg2);
  public final static native void Cpu_setState(long jarg1, Cpu jarg1_, int jarg2);
  public final static native void Cpu_director_connect(Cpu obj, long cptr, boolean mem_own, boolean weak_global);
  public final static native void Cpu_change_ownership(Cpu obj, long cptr, boolean take_or_release);
  public final static native void delete_NetworkLink(long jarg1);
  public final static native double NetworkLink_getBandwidth(long jarg1, NetworkLink jarg1_);
  public final static native void NetworkLink_updateBandwidth__SWIG_0(long jarg1, NetworkLink jarg1_, double jarg2, double jarg3);
  public final static native void NetworkLink_updateBandwidth__SWIG_1(long jarg1, NetworkLink jarg1_, double jarg2);
  public final static native double NetworkLink_getLatency(long jarg1, NetworkLink jarg1_);
  public final static native void NetworkLink_updateLatency__SWIG_0(long jarg1, NetworkLink jarg1_, double jarg2, double jarg3);
  public final static native void NetworkLink_updateLatency__SWIG_1(long jarg1, NetworkLink jarg1_, double jarg2);
  public final static native long new_Action(long jarg1, Model jarg1_, double jarg2, boolean jarg3);
  public final static native void delete_Action(long jarg1);
  public final static native long Action_getModel(long jarg1, Action jarg1_);
  public final static native long Action_getVariable(long jarg1, Action jarg1_);
  public final static native int Action_getState(long jarg1, Action jarg1_);
  public final static native boolean Action_isSuspended(long jarg1, Action jarg1_);
  public final static native double Action_getBound(long jarg1, Action jarg1_);
  public final static native void Action_setBound(long jarg1, Action jarg1_, double jarg2);
  public final static native void Action_updateRemains(long jarg1, Action jarg1_, double jarg2);
  public final static native double Action_getRemains(long jarg1, Action jarg1_);
  public final static native void Action_setPriority(long jarg1, Action jarg1_, double jarg2);
  public final static native void Action_setState(long jarg1, Action jarg1_, int jarg2);
  public final static native long new_CpuAction(long jarg1, Model jarg1_, double jarg2, boolean jarg3);
  public final static native long CpuAction_getCpu(long jarg1, CpuAction jarg1_);
  public final static native void delete_CpuAction(long jarg1);
  public final static native void CpuAction_director_connect(CpuAction obj, long cptr, boolean mem_own, boolean weak_global);
  public final static native void CpuAction_change_ownership(CpuAction obj, long cptr, boolean take_or_release);
  public final static native double NetworkAction_getLatency(long jarg1, NetworkAction jarg1_);
  public final static native void delete_NetworkAction(long jarg1);
  public final static native String RoutingEdge_getName(long jarg1, RoutingEdge jarg1_);
  public final static native void delete_RoutingEdge(long jarg1);
  public final static native double LmmConstraint_getUsage(long jarg1, LmmConstraint jarg1_);
  public final static native long new_LmmConstraint();
  public final static native void delete_LmmConstraint(long jarg1);
  public final static native double LmmVariable_getValue(long jarg1, LmmVariable jarg1_);
  public final static native long new_LmmVariable();
  public final static native void delete_LmmVariable(long jarg1);
  public final static native String XbtDict_getValue(long jarg1, XbtDict jarg1_, String jarg2);
  public final static native long new_XbtDict();
  public final static native void delete_XbtDict(long jarg1);
  public final static native int SURF_ACTION_READY_get();
  public final static native int SURF_RESOURCE_ON_get();
  public final static native int SURF_RESOURCE_OFF_get();
  public final static native long CpuModel_SWIGUpcast(long jarg1);
  public final static native long Cpu_SWIGUpcast(long jarg1);
  public final static native long NetworkLink_SWIGUpcast(long jarg1);
  public final static native long CpuAction_SWIGUpcast(long jarg1);
  public final static native long NetworkAction_SWIGUpcast(long jarg1);

  public static void SwigDirector_Plugin_cpuCreatedCallback(Plugin self, long cpu) {
    self.cpuCreatedCallback((cpu == 0) ? null : new Cpu(cpu, false));
  }
  public static void SwigDirector_Plugin_cpuDestructedCallback(Plugin self, long cpu) {
    self.cpuDestructedCallback((cpu == 0) ? null : new Cpu(cpu, false));
  }
  public static void SwigDirector_Plugin_cpuStateChangedCallback(Plugin self, long cpu, int arg1, int arg2) {
    self.cpuStateChangedCallback((cpu == 0) ? null : new Cpu(cpu, false), ResourceState.swigToEnum(arg1), ResourceState.swigToEnum(arg2));
  }
  public static void SwigDirector_Plugin_cpuActionStateChangedCallback(Plugin self, long action, int arg1, int arg2) {
    self.cpuActionStateChangedCallback((action == 0) ? null : new CpuAction(action, false), ActionState.swigToEnum(arg1), ActionState.swigToEnum(arg2));
  }
  public static void SwigDirector_Plugin_networkLinkCreatedCallback(Plugin self, long link) {
    self.networkLinkCreatedCallback((link == 0) ? null : new NetworkLink(link, false));
  }
  public static void SwigDirector_Plugin_networkLinkDestructedCallback(Plugin self, long link) {
    self.networkLinkDestructedCallback((link == 0) ? null : new NetworkLink(link, false));
  }
  public static void SwigDirector_Plugin_networkLinkStateChangedCallback(Plugin self, long link, int arg1, int arg2) {
    self.networkLinkStateChangedCallback((link == 0) ? null : new NetworkLink(link, false), ResourceState.swigToEnum(arg1), ResourceState.swigToEnum(arg2));
  }
  public static void SwigDirector_Plugin_networkActionStateChangedCallback(Plugin self, long action, int old, int cur) {
    self.networkActionStateChangedCallback((action == 0) ? null : new NetworkAction(action, false), ActionState.swigToEnum(old), ActionState.swigToEnum(cur));
  }
  public static void SwigDirector_Plugin_networkCommunicateCallback(Plugin self, long action, long src, long dst, double size, double rate) {
    self.networkCommunicateCallback((action == 0) ? null : new NetworkAction(action, false), (src == 0) ? null : new RoutingEdge(src, false), (dst == 0) ? null : new RoutingEdge(dst, false), size, rate);
  }
  public static double SwigDirector_CpuModel_shareResources(CpuModel self, double now) {
    return self.shareResources(now);
  }
  public static double SwigDirector_CpuModel_shareResourcesLazy(CpuModel self, double now) {
    return self.shareResourcesLazy(now);
  }
  public static double SwigDirector_CpuModel_shareResourcesFull(CpuModel self, double now) {
    return self.shareResourcesFull(now);
  }
  public static void SwigDirector_CpuModel_updateActionsState(CpuModel self, double now, double delta) {
    self.updateActionsState(now, delta);
  }
  public static void SwigDirector_CpuModel_updateActionsStateLazy(CpuModel self, double now, double delta) {
    self.updateActionsStateLazy(now, delta);
  }
  public static void SwigDirector_CpuModel_updateActionsStateFull(CpuModel self, double now, double delta) {
    self.updateActionsStateFull(now, delta);
  }
  public static long SwigDirector_CpuModel_getRunningActionSet(CpuModel self) {
    return ActionList.getCPtr(self.getRunningActionSet());
  }
  public static void SwigDirector_CpuModel_addTraces(CpuModel self) {
    self.addTraces();
  }
  public static long SwigDirector_CpuModel_createCpu(CpuModel self, String name, double[] power_peak, int pstate, double power_scale, long power_trace, int core, int state_initial, long state_trace, long cpu_properties) {
    return Cpu.getCPtr(self.createCpu(name, power_peak, pstate, power_scale, (power_trace == 0) ? null : new TmgrTrace(power_trace, false), core, ResourceState.swigToEnum(state_initial), (state_trace == 0) ? null : new TmgrTrace(state_trace, false), (cpu_properties == 0) ? null : new XbtDict(cpu_properties, false)));
  }
  public static boolean SwigDirector_Cpu_isUsed(Cpu self) {
    return self.isUsed();
  }
  public static int SwigDirector_Cpu_getState(Cpu self) {
    return (self.getState()).swigValue();
  }
  public static void SwigDirector_Cpu_updateState(Cpu self, long event_type, double value, double date) {
    self.updateState((event_type == 0) ? null : new TmgrTraceEvent(event_type, false), value, date);
  }
  public static double SwigDirector_Cpu_getCurrentPowerPeak(Cpu self) {
    return self.getCurrentPowerPeak();
  }
  public static long SwigDirector_Cpu_execute(Cpu self, double size) {
    return CpuAction.getCPtr(self.execute(size));
  }
  public static long SwigDirector_Cpu_sleep(Cpu self, double duration) {
    return CpuAction.getCPtr(self.sleep(duration));
  }
  public static int SwigDirector_Cpu_getCore(Cpu self) {
    return self.getCore();
  }
  public static double SwigDirector_Cpu_getSpeed(Cpu self, double load) {
    return self.getSpeed(load);
  }
  public static double SwigDirector_Cpu_getAvailableSpeed(Cpu self) {
    return self.getAvailableSpeed();
  }
  public static double SwigDirector_Cpu_getPowerPeakAt(Cpu self, int pstate_index) {
    return self.getPowerPeakAt(pstate_index);
  }
  public static int SwigDirector_Cpu_getNbPstates(Cpu self) {
    return self.getNbPstates();
  }
  public static void SwigDirector_Cpu_setPowerPeakAt(Cpu self, int pstate_index) {
    self.setPowerPeakAt(pstate_index);
  }
  public static double SwigDirector_CpuAction_getRemains(CpuAction self) {
    return self.getRemains();
  }
  public static void SwigDirector_CpuAction_setPriority(CpuAction self, double priority) {
    self.setPriority(priority);
  }
  public static void SwigDirector_CpuAction_setState(CpuAction self, int state) {
    self.setState(ActionState.swigToEnum(state));
  }

  private final static native void swig_module_init();
  static {
    swig_module_init();
  }
}
