Tabnine Logo
TimeResource.create
Code IndexAdd Tabnine to your IDE (free)

How to use
create
method
in
org.ogema.core.model.simple.TimeResource

Best Java code snippets using org.ogema.core.model.simple.TimeResource.create (Showing top 12 results out of 315)

origin: org.ogema.tools/system-supervision

  @Override
  public void timerElapsed(Timer timer /* may be null */) {
    if (!ramCheckSemaphore.tryAcquire())
      return;
    try {
      final Runtime runtime = Runtime.getRuntime();
      runtime.gc();
      final long used = ( runtime.totalMemory() - runtime.freeMemory());
      final long memMax = runtime.maxMemory();
      config.results().usedMemorySize().<TimeResource> create().setValue(used);
      config.results().maxAvailableMemorySize().<TimeResource> create().setValue(memMax); // should not really change
      config.results().usedMemorySize().activate(false);
      config.results().maxAvailableMemorySize().activate(false);
      appMan.getLogger().info("RAM used: {} MB, max. RAM available: {}", (used/mb), (memMax/mb));
    } finally {
      ramCheckSemaphore.release();
    }
  }
};
origin: org.ogema.tools/system-supervision

public static long getInterval(final TimeResource itvRes, long defaultItv) {
  long proposed = 0;
  if (itvRes.isActive())
    proposed = itvRes.getValue();
  if (proposed < MIN_SUPERVISION_ITV) {
    proposed = defaultItv;
    itvRes.<TimeResource> create().setValue(defaultItv);
    itvRes.activate(false);
  }
  return proposed;
}
origin: org.ogema.tools/resource-manipulators

private ScheduleReductionAction getResourceFromConfig(TimeSeriesReduction config, long ageThreshold) {
  ScheduleReductionAction resource = null;
  if (config instanceof DeletionAction) {
    resource = this.config.actions().getSubResource(getNextActionName(), ScheduleDeletionAction.class).create();
  }
  else if (config instanceof InterpolationAction) {
    resource = this.config.actions().getSubResource(getNextActionName(), ScheduleDownsamplingAction.class).create();
    ((ScheduleDownsamplingAction) resource).minInterval().<TimeResource> create().setValue(((InterpolationAction) config).getMinInterval());
  }
  else if (config instanceof StepsReductionAction) {
    resource = this.config.actions().getSubResource(getNextActionName(), ScheduleStepsReductionAction.class).create();
  }
  else 
    throw new IllegalArgumentException("TimeSeriesReduction must be either a deletion action or a interpolation action; got " + config.getClass().getName() );
  if (resource != null) {
    resource.ageThreshold().<TimeResource> create().setValue(ageThreshold);
  }
  return resource;
}
 
origin: org.ogema.tools/system-supervision

  @Override
  public void timerElapsed(Timer timer /* may be null */) {
    if (!diskCheckSemaphore.tryAcquire())
      return;
    try {
      final long dataSize = size(Paths.get("./data"));
      final long rundirSize = size(Paths.get("."));
      long free = Long.MIN_VALUE;
      try {
        free = Files.getFileStore(Paths.get("/")).getUsableSpace();
      } catch (IOException e) {
        appMan.getLogger().warn("Error determining free disk space",e);
      }
      config.results().rundirFolderSize().<TimeResource> create().setValue(rundirSize);
      config.results().dataFolderSize().<TimeResource> create().setValue(dataSize);
      if (free != Long.MIN_VALUE)
        config.results().freeDiskSpace().<TimeResource> create().setValue(free);
      config.results().rundirFolderSize().activate(false);
      config.results().dataFolderSize().activate(false);
      config.results().freeDiskSpace().activate(false);
      appMan.getLogger().info("Rundir folder size: {} MB, data folder: {} MB, free disk space: {} MB", 
          (rundirSize/mb), (dataSize/mb), (free != Long.MIN_VALUE ? (free/mb) : "n.a."));
    } finally {
      diskCheckSemaphore.release();
    }
  }
};
origin: org.ogema.tools/resource-manipulators

config.targetResourceParent().create();
config.targetResourceParent().addDecorator("schedule",targetResource);
config.updateInterval().create();
config.updateInterval().setValue(updateInterval);
config.actions().create();
origin: org.smartrplace.apps/smartrplace-util-proposed

source.create();
source.setValue(value);
source.activate(true);
origin: org.ogema.tools/resource-manipulators

@Override
public boolean commit() {
  if (m_inputs == null || m_output == null) {
    return false;
  }
  // delete the old configuration if it exsited.
  if (m_config != null)
    m_config.delete();
  m_config = m_base.createResource(SumModel.class);
  m_config.inputs().create();
  for (SingleValueResource val : m_inputs) {
    if (!val.exists()) {
      val.create();
      LoggerFactory.getLogger(ResourceManipulatorImpl.class).warn("Virtual resource passed to Sum configuration; creating it. {}",val);
    }
    m_config.inputs().add(val);
  }
  m_config.resultBase().setAsReference(m_output);
  m_config.delay().create();
  m_config.delay().setValue(m_delay);
  m_config.deactivateEmptySum().create();
  m_config.deactivateEmptySum().setValue(m_deactivateEmtpySum);
  m_config.activate(true);
  return true;
}
origin: org.ogema.tools/resource-manipulators

m_config.delay().create();
m_config.delay().setValue(m_delay);
m_config.deactivateEmptySum().create();
origin: org.ogema.tools/system-supervision

public Tasks(ApplicationManager appMan, SystemSupervisionConfig config) {
  this.appMan = appMan;
  this.config = config;
  this.diskTimer = appMan.createTimer(SupervisionUtils.getInterval(config.diskCheckInterval(), SupervisionUtils.DEFAULT_DISK_SUPERVISION_ITV), diskSupervision);
  this.ramTimer = appMan.createTimer(SupervisionUtils.getInterval(config.memoryCheckInterval(), SupervisionUtils.DEFAULT_RAM_SUPERVISION_ITV), ramSupervision);
  this.resourceTimer = appMan.createTimer(SupervisionUtils.getInterval(config.resourceCheckInterval(), SupervisionUtils.DEFAULT_RESOURCE_SUPERVISION_ITV), resourceSupervision);
  config.lastStart().<TimeResource> create().setValue(appMan.getFrameworkTime());
  config.lastStart().activate(false);
  // run all timers once at the beginning
  this.startTimer = appMan.createTimer(5*1000, new TimerListener() {
    
    @Override
    public void timerElapsed(Timer timer) {
      timer.destroy();
      diskSupervision.timerElapsed(diskTimer);
      ramSupervision.timerElapsed(ramTimer);
      resourceSupervision.timerElapsed(resourceTimer);
    }
  });
}
 
origin: org.smartrplace.sim/resource-simulation

if (forecast != null) {
  config.forecastSchedule().<StringResource> create().setValue(forecast);
  config.forecastHorizon().<TimeResource> create().setValue(horizon);
origin: org.ogema.tools/resource-manipulators

@Override
public boolean commit() {
  if (m_targetResource == null) {
    return false;
  }
  // delete the old configuration if it exsited.
  if (m_config != null) {
    m_config.delete();
  }
  m_config = m_base.createResource(ProgramEnforcerModel.class);
  m_config.targetResource().setAsReference(m_targetResource);
  m_config.updateInterval().create();
  m_config.updateInterval().setValue(m_updateInterval);
  m_config.exclusiveAccessRequired().create();
  m_config.exclusiveAccessRequired().setValue(m_exclusiveAccessRequired);
  m_config.priority().create();
  m_config.priority().setValue(m_priority.toString());
  m_config.deactivateIfValueMissing().create();
  m_config.deactivateIfValueMissing().setValue(m_deactivate);
  if (m_scheduleName != null) {
    m_config.scheduleResourceName().<StringResource> create().setValue(m_scheduleName);
  }
  m_config.activate(true);
  return true;
}
origin: org.ogema.drivers/knx

time.create();
org.ogema.core.model.simpleTimeResourcecreate

Popular methods of TimeResource

  • getValue
  • setValue
  • isActive
  • getHistoricalData
  • exists
  • activate
  • historicalData
  • forecast
  • getPath
  • program

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • String (java.lang)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now