All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.ssc.step.parallel.Task Maven / Gradle / Ivy

Go to download

This is a JSR331 interface for SSC (Software for the Calculation of the Simplex) is a java library for solving linear programming problems v. 3.0.1. SSC was designed and developed by Stefano Scarioli.

The newest version!
package it.ssc.step.parallel;

import java.util.concurrent.CyclicBarrier;
import java.util.logging.Level;
import java.util.logging.Logger;

import it.ssc.log.SscLogger;

 public class Task implements Runnable {

	private static final Logger logger=SscLogger.getLogger();
	private CyclicBarrier barrier;
	private Parallelizable step;

	public Task(CyclicBarrier barrier, Parallelizable step) {
		this.barrier = barrier;
		this.step = step;
	}

	public void run()  {
		try {
			step.run(); 
			barrier.await();
		} 
		catch (Exception e) {
			logger.log(Level.SEVERE,"Execution run() method of ParallelProcesses",e);
			throw new RuntimeException(e);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy