本文整理汇总了Java中org.apache.commons.math3.ode.events.EventHandler类的典型用法代码示例。如果您正苦于以下问题:Java EventHandler类的具体用法?Java EventHandler怎么用?Java EventHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventHandler类属于org.apache.commons.math3.ode.events包,在下文中一共展示了EventHandler类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: eventOccurred
import org.apache.commons.math3.ode.events.EventHandler; //导入依赖的package包/类
@Override
public Action eventOccurred(double t, double[] y, boolean increasing) {
value = -value;
currentTime.setValue(t);
vectorWrapper.setValues(y);
computeRates();
for (HierarchicalModel modelstate : modules) {
int index = modelstate.getIndex();
for (EventNode event : modelstate.getEvents()) {
if(event.getMaxDisabledTime(index) > t)
{
event.setMaxDisabledTime(index, t);
}
}
}
computeEvents();
return EventHandler.Action.STOP;
}
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:20,代码来源:HierarchicalODERKSimulator.java
示例2: eventOccurred
import org.apache.commons.math3.ode.events.EventHandler; //导入依赖的package包/类
@Override
public Action eventOccurred(double t, double[] y, boolean increasing) {
if (increasing && !dirIncrease) {
return EventHandler.Action.CONTINUE;
} else {
this.t = t;
return EventHandler.Action.STOP;
}
}
开发者ID:liampetti,项目名称:jADM1_BSM,代码行数:10,代码来源:DiscreteEvent.java
示例3: addEventHandler
import org.apache.commons.math3.ode.events.EventHandler; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void addEventHandler(final EventHandler function,
final double maxCheckInterval,
final double convergence,
final int maxIterationCount,
final UnivariateSolver solver) {
super.addEventHandler(function, maxCheckInterval, convergence,
maxIterationCount, solver);
// reinitialize the arrays
initializeArrays();
}
开发者ID:biocompibens,项目名称:SME,代码行数:15,代码来源:GraggBulirschStoerIntegrator.java
示例4: addEventHandler
import org.apache.commons.math3.ode.events.EventHandler; //导入依赖的package包/类
/** {@inheritDoc} */
public void addEventHandler(final EventHandler handler,
final double maxCheckInterval,
final double convergence,
final int maxIterationCount) {
addEventHandler(handler, maxCheckInterval, convergence,
maxIterationCount,
new BracketingNthOrderBrentSolver(convergence, 5));
}
开发者ID:biocompibens,项目名称:SME,代码行数:10,代码来源:AbstractIntegrator.java
示例5: getEventHandlers
import org.apache.commons.math3.ode.events.EventHandler; //导入依赖的package包/类
/** {@inheritDoc} */
public Collection<EventHandler> getEventHandlers() {
final List<EventHandler> list = new ArrayList<EventHandler>(eventsStates.size());
for (EventState state : eventsStates) {
list.add(state.getEventHandler());
}
return Collections.unmodifiableCollection(list);
}
开发者ID:biocompibens,项目名称:SME,代码行数:9,代码来源:AbstractIntegrator.java
示例6: testEvents
import org.apache.commons.math3.ode.events.EventHandler; //导入依赖的package包/类
@Test
public void testEvents()
throws DimensionMismatchException, NumberIsTooSmallException,
MaxCountExceededException, NoBracketingException {
TestProblem4 pb = new TestProblem4();
double minStep = 0;
double maxStep = pb.getFinalTime() - pb.getInitialTime();
double scalAbsoluteTolerance = 1.0e-8;
double scalRelativeTolerance = 0.01 * scalAbsoluteTolerance;
FirstOrderIntegrator integ = new DormandPrince54Integrator(minStep, maxStep,
scalAbsoluteTolerance,
scalRelativeTolerance);
TestProblemHandler handler = new TestProblemHandler(pb, integ);
integ.addStepHandler(handler);
EventHandler[] functions = pb.getEventsHandlers();
double convergence = 1.0e-8 * maxStep;
for (int l = 0; l < functions.length; ++l) {
integ.addEventHandler(functions[l],
Double.POSITIVE_INFINITY, convergence, 1000);
}
Assert.assertEquals(functions.length, integ.getEventHandlers().size());
integ.integrate(pb,
pb.getInitialTime(), pb.getInitialState(),
pb.getFinalTime(), new double[pb.getDimension()]);
Assert.assertTrue(handler.getMaximalValueError() < 5.0e-6);
Assert.assertEquals(0, handler.getMaximalTimeError(), convergence);
Assert.assertEquals(12.0, handler.getLastTime(), convergence);
integ.clearEventHandlers();
Assert.assertEquals(0, integ.getEventHandlers().size());
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:35,代码来源:DormandPrince54IntegratorTest.java
示例7: testEvents
import org.apache.commons.math3.ode.events.EventHandler; //导入依赖的package包/类
@Test
public void testEvents()
throws DimensionMismatchException, NumberIsTooSmallException,
MaxCountExceededException, NoBracketingException {
TestProblem4 pb = new TestProblem4();
double minStep = 0;
double maxStep = pb.getFinalTime() - pb.getInitialTime();
double scalAbsoluteTolerance = 1.0e-9;
double scalRelativeTolerance = 0.01 * scalAbsoluteTolerance;
FirstOrderIntegrator integ = new DormandPrince853Integrator(minStep, maxStep,
scalAbsoluteTolerance,
scalRelativeTolerance);
TestProblemHandler handler = new TestProblemHandler(pb, integ);
integ.addStepHandler(handler);
EventHandler[] functions = pb.getEventsHandlers();
double convergence = 1.0e-8 * maxStep;
for (int l = 0; l < functions.length; ++l) {
integ.addEventHandler(functions[l], Double.POSITIVE_INFINITY, convergence, 1000);
}
Assert.assertEquals(functions.length, integ.getEventHandlers().size());
integ.integrate(pb,
pb.getInitialTime(), pb.getInitialState(),
pb.getFinalTime(), new double[pb.getDimension()]);
Assert.assertEquals(0, handler.getMaximalValueError(), 2.1e-7);
Assert.assertEquals(0, handler.getMaximalTimeError(), convergence);
Assert.assertEquals(12.0, handler.getLastTime(), convergence);
integ.clearEventHandlers();
Assert.assertEquals(0, integ.getEventHandlers().size());
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:34,代码来源:DormandPrince853IntegratorTest.java
示例8: testEvents
import org.apache.commons.math3.ode.events.EventHandler; //导入依赖的package包/类
@Test
public void testEvents()
throws DimensionMismatchException, NumberIsTooSmallException,
MaxCountExceededException, NoBracketingException {
TestProblem4 pb = new TestProblem4();
double minStep = 0;
double maxStep = pb.getFinalTime() - pb.getInitialTime();
double scalAbsoluteTolerance = 1.0e-8;
double scalRelativeTolerance = 0.01 * scalAbsoluteTolerance;
FirstOrderIntegrator integ = new HighamHall54Integrator(minStep, maxStep,
scalAbsoluteTolerance,
scalRelativeTolerance);
TestProblemHandler handler = new TestProblemHandler(pb, integ);
integ.addStepHandler(handler);
EventHandler[] functions = pb.getEventsHandlers();
double convergence = 1.0e-8 * maxStep;
for (int l = 0; l < functions.length; ++l) {
integ.addEventHandler(functions[l],
Double.POSITIVE_INFINITY, convergence, 1000);
}
Assert.assertEquals(functions.length, integ.getEventHandlers().size());
integ.integrate(pb,
pb.getInitialTime(), pb.getInitialState(),
pb.getFinalTime(), new double[pb.getDimension()]);
Assert.assertTrue(handler.getMaximalValueError() < 1.0e-7);
Assert.assertEquals(0, handler.getMaximalTimeError(), convergence);
Assert.assertEquals(12.0, handler.getLastTime(), convergence);
integ.clearEventHandlers();
Assert.assertEquals(0, integ.getEventHandlers().size());
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:35,代码来源:HighamHall54IntegratorTest.java
示例9: testEvents
import org.apache.commons.math3.ode.events.EventHandler; //导入依赖的package包/类
@Test
public void testEvents()
throws DimensionMismatchException, NumberIsTooSmallException,
MaxCountExceededException, NoBracketingException {
TestProblem4 pb = new TestProblem4();
double minStep = 0;
double maxStep = pb.getFinalTime() - pb.getInitialTime();
double scalAbsoluteTolerance = 1.0e-10;
double scalRelativeTolerance = 0.01 * scalAbsoluteTolerance;
FirstOrderIntegrator integ = new GraggBulirschStoerIntegrator(minStep, maxStep,
scalAbsoluteTolerance,
scalRelativeTolerance);
TestProblemHandler handler = new TestProblemHandler(pb, integ);
integ.addStepHandler(handler);
EventHandler[] functions = pb.getEventsHandlers();
double convergence = 1.0e-8 * maxStep;
for (int l = 0; l < functions.length; ++l) {
integ.addEventHandler(functions[l], Double.POSITIVE_INFINITY, convergence, 1000);
}
Assert.assertEquals(functions.length, integ.getEventHandlers().size());
integ.integrate(pb,
pb.getInitialTime(), pb.getInitialState(),
pb.getFinalTime(), new double[pb.getDimension()]);
Assert.assertTrue(handler.getMaximalValueError() < 4.0e-7);
Assert.assertEquals(0, handler.getMaximalTimeError(), convergence);
Assert.assertEquals(12.0, handler.getLastTime(), convergence);
integ.clearEventHandlers();
Assert.assertEquals(0, integ.getEventHandlers().size());
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:34,代码来源:GraggBulirschStoerIntegratorTest.java
示例10: getEventHandlers
import org.apache.commons.math3.ode.events.EventHandler; //导入依赖的package包/类
/** {@inheritDoc} */
public Collection<EventHandler> getEventHandlers() {
final List<EventHandler> list = new ArrayList<EventHandler>();
for (EventState state : eventsStates) {
list.add(state.getEventHandler());
}
return Collections.unmodifiableCollection(list);
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:9,代码来源:AbstractIntegrator.java
注:本文中的org.apache.commons.math3.ode.events.EventHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论