- java.lang.Object
-
- org.logicng.handlers.ComputationHandler
-
- org.logicng.handlers.TimeoutHandler
-
- org.logicng.handlers.TimeoutBDDHandler
-
- All Implemented Interfaces:
BDDHandler,Handler
public class TimeoutBDDHandler extends TimeoutHandler implements BDDHandler
A BDD handler which cancels the build process after a given timeout.- Since:
- 1.6.2
- Version:
- 2.1.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.logicng.handlers.TimeoutHandler
TimeoutHandler.TimerType
-
-
Field Summary
-
Fields inherited from class org.logicng.handlers.TimeoutHandler
designatedEnd, timeout, type
-
Fields inherited from class org.logicng.handlers.ComputationHandler
aborted
-
-
Constructor Summary
Constructors Constructor Description TimeoutBDDHandler(long timeout)Constructs a new timeout handler with a given timeout and uses the timeout typeTimeoutHandler.TimerType.SINGLE_TIMEOUT.TimeoutBDDHandler(long timeout, TimeoutHandler.TimerType type)Constructs a new timeout handler with a given timeout and a timeout type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleannewRefAdded()This method is called every time a new reference is added, i.e.-
Methods inherited from class org.logicng.handlers.TimeoutHandler
started, timeLimitExceeded
-
Methods inherited from class org.logicng.handlers.ComputationHandler
aborted
-
-
-
-
Constructor Detail
-
TimeoutBDDHandler
public TimeoutBDDHandler(long timeout, TimeoutHandler.TimerType type)Constructs a new timeout handler with a given timeout and a timeout type. The interpretation of the timeout depends on the timeout type:TimeoutHandler.TimerType.SINGLE_TIMEOUT: The timeout is started whenHandler.started()is called. Further calls toHandler.started()have no effect on the timeout. Thus, the timeout can only be started once.TimeoutHandler.TimerType.RESTARTING_TIMEOUT: The timeout is restarted whenHandler.started()is called.TimeoutHandler.TimerType.FIXED_END: Timeout which is interpreted as fixed point in time (in milliseconds) at which the computation should be aborted. The methodHandler.started()must still be called, but does not have an effect on the timeout.
BDDKernel.addRef(int, BDDHandler).- Parameters:
timeout- the timeout in milliseconds, its meaning is defined by the timeout typetype- the type of the timer, must not benull
-
TimeoutBDDHandler
public TimeoutBDDHandler(long timeout)
Constructs a new timeout handler with a given timeout and uses the timeout typeTimeoutHandler.TimerType.SINGLE_TIMEOUT. Thus, the timeout is started whenHandler.started()is called and further calls toHandler.started()have no effect on the timeout.- Parameters:
timeout- the timeout in milliseconds
-
-
Method Detail
-
newRefAdded
public boolean newRefAdded()
Description copied from interface:BDDHandlerThis method is called every time a new reference is added, i.e. the methodBDDKernel.addRef(int, BDDHandler)is called.- Specified by:
newRefAddedin interfaceBDDHandler- Returns:
trueif the BDD generation should be continued, otherwisefalse
-
-