public class CarbonAccountingTool extends AbstractGenericEngine implements REpiceaShowableUIWithParent, REpiceaShowableUI
Modifier and Type | Class and Description |
---|---|
static class |
CarbonAccountingTool.CATMode |
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
englishTitle |
protected boolean |
finalCutHadToBeCarriedOut |
protected static java.lang.String |
frenchTitle |
protected CATFrame |
guiInterface |
protected static boolean |
hasAlreadyBeenInstanciated |
protected java.awt.Window |
owner |
protected java.awt.Window |
parentFrame |
protected java.util.List<CATCompatibleStand> |
waitingStandList |
finalTask, logger, queue, tasksDone
Constructor and Description |
---|
CarbonAccountingTool()
Constructor for stand alone application.
|
CarbonAccountingTool(CarbonAccountingTool.CATMode mode)
Generic constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateCarbon()
This method launches the calculation of the different carbon compartments.
|
CATExportTool |
createExportTool()
This method returns an export tool adapted to the carbon accounting tool.
|
protected void |
decideWhatToDoInCaseOfFailure(GenericTask task)
This method is called whenever an exception is thrown while running a task.
|
protected java.util.Vector<TreeLoggerDescription> |
findMatchingTreeLoggers(TreeLoggerCompatibilityCheck check) |
protected void |
firstTasksToDo()
This method sets the first tasks to execute when the engine starts.
|
protected CATCompartmentManager |
getCarbonCompartmentManager() |
protected CATSettings |
getCarbonToolSettings()
This method returns the settings of the carbon accounting tool.
|
CATFrame |
getUI()
This method returns the GUI interface of the class that implements this interface.
|
CATFrame |
getUI(java.awt.Container parent)
This method returns the GUI interface of the class that implements this interface.
|
void |
initializeTool()
Initializes CAT without parent window.
|
void |
initializeTool(java.awt.Window parentFrame)
This method initializes the carbon accounting tool either in script or in GUI mode.
|
protected boolean |
isGuiEnabled() |
boolean |
isInitialized()
This method returns true if this CAT instance has been initialized or false otherwise
|
boolean |
isShuttedDown()
This method returns true if CAT has been shutted down or false otherwise.
|
boolean |
isVisible()
This method returns true if the GUI is visible.
|
protected void |
lockEngine()
This method locks the engine while the interface can be doing something else.
|
static void |
main(java.lang.String[] args) |
protected void |
respondToWindowClosing()
By default, closing the gui shuts the engine down.
|
CATSimulationResult |
retrieveSimulationSummary()
This method retrieves the simulation results after calling the calculateCarbon method.
|
protected void |
setBiomassParameters() |
void |
setBiomassParameters(java.lang.String filename)
This method sets the biomass parameters for the next simulation in script mode.
|
protected void |
setFinalCutHadToBeCarriedOut(boolean finalCutHadToBeCarriedOut) |
protected void |
setProductionManager() |
void |
setProductionManager(java.lang.String filename)
This method sets the production lines for the next simulation in script mode.
|
protected void |
setStandList() |
void |
setStandList(java.util.List<CATCompatibleStand> standList)
This method sets the list of stands from which the carbon balance should be calculated.
|
void |
setVariabilitySource(CATSensitivityAnalysisSettings.VariabilitySource source,
Distribution.Type type,
boolean enabled)
This method sets the different parameters of the sensitivity analysis at the level suggested by the IPCC.
|
void |
setVariabilitySource(CATSensitivityAnalysisSettings.VariabilitySource source,
Distribution.Type type,
boolean enabled,
double multiplier)
This method sets the different parameters of the sensitivity analysis
|
void |
setVerboseEnabled(boolean bool)
This method enables messages all along the process chain.
|
protected void |
showResult() |
void |
showUI()
This method shows the GUI interface of the class that implements this interface.
|
void |
showUI(java.awt.Window parent)
This method shows the GUI interface of the class that implements this interface.
|
protected void |
shutdown(int shutdownCode) |
protected void |
unlockEngine()
This method unlock the engine if locked.
|
addTask, addTasks, cancelRunningTask, getSettingMemory, lockEngine, requestShutdown, setSettingMemory, startApplication
protected static final java.lang.String englishTitle
protected static final java.lang.String frenchTitle
protected static boolean hasAlreadyBeenInstanciated
protected boolean finalCutHadToBeCarriedOut
protected java.awt.Window parentFrame
protected java.util.List<CATCompatibleStand> waitingStandList
protected transient CATFrame guiInterface
protected transient java.awt.Window owner
public CarbonAccountingTool()
public CarbonAccountingTool(CarbonAccountingTool.CATMode mode)
mode
- defines how CAT is to be used. See the CATMode enum variable.protected void shutdown(int shutdownCode)
shutdown
in class AbstractGenericEngine
public boolean isShuttedDown()
protected CATSettings getCarbonToolSettings()
public void setVerboseEnabled(boolean bool)
bool
- public void initializeTool() throws java.lang.Exception
java.lang.Exception
public void initializeTool(java.awt.Window parentFrame) throws java.lang.Exception
parentFrame
- the parent frame which can be nulljava.lang.Exception
public void setStandList(java.util.List<CATCompatibleStand> standList)
standList
- a List of CarbonToolCompatibleStand instanceprotected void setStandList()
protected java.util.Vector<TreeLoggerDescription> findMatchingTreeLoggers(TreeLoggerCompatibilityCheck check)
protected void firstTasksToDo()
AbstractGenericEngine
firstTasksToDo
in class AbstractGenericEngine
protected void decideWhatToDoInCaseOfFailure(GenericTask task)
AbstractGenericEngine
decideWhatToDoInCaseOfFailure
in class AbstractGenericEngine
task
- a GenericTask instancepublic CATSimulationResult retrieveSimulationSummary()
protected CATCompartmentManager getCarbonCompartmentManager()
public void calculateCarbon() throws java.security.InvalidParameterException, java.lang.InterruptedException
java.lang.InterruptedException
- if the engine lock is interruptedjava.security.InvalidParameterException
- if the CarbonToolSettings instance is invalidprotected boolean isGuiEnabled()
protected void unlockEngine()
AbstractGenericEngine
unlockEngine
in class AbstractGenericEngine
protected void lockEngine() throws java.lang.InterruptedException
AbstractGenericEngine
lockEngine
in class AbstractGenericEngine
java.lang.InterruptedException
protected void setFinalCutHadToBeCarriedOut(boolean finalCutHadToBeCarriedOut)
public CATExportTool createExportTool() throws java.lang.Exception
java.lang.Exception
protected void respondToWindowClosing()
public CATFrame getUI(java.awt.Container parent)
REpiceaUIObjectWithParent
getUI
in interface REpiceaUIObjectWithParent
parent
- a parent Container instance (can be null)public void showUI(java.awt.Window parent)
REpiceaShowableUIWithParent
showUI
in interface REpiceaShowableUIWithParent
parent
- the parent Window instance (can be null)public CATFrame getUI()
REpiceaUIObject
getUI
in interface REpiceaUIObject
public void showUI()
REpiceaShowableUI
showUI
in interface REpiceaShowableUI
protected void showResult()
public boolean isVisible()
REpiceaUIObjectWithParent
isVisible
in interface REpiceaUIObject
isVisible
in interface REpiceaUIObjectWithParent
public void setBiomassParameters(java.lang.String filename) throws java.lang.InterruptedException
filename
- a String that defines the filename (.bpf) of the biomass parametersjava.lang.InterruptedException
java.io.IOException
protected void setBiomassParameters() throws java.io.IOException
java.io.IOException
public void setProductionManager(java.lang.String filename) throws java.lang.InterruptedException
filename
- a String that defines the filename (.prl) of the processor managerjava.lang.InterruptedException
java.io.IOException
protected void setProductionManager() throws java.io.IOException
java.io.IOException
public void setVariabilitySource(CATSensitivityAnalysisSettings.VariabilitySource source, Distribution.Type type, boolean enabled)
source
- the source of variabilitytype
- the distribution (either uniform (default) or Gaussianenabled
- true to enable or false to disablepublic void setVariabilitySource(CATSensitivityAnalysisSettings.VariabilitySource source, Distribution.Type type, boolean enabled, double multiplier)
source
- the source of variabilitytype
- the distribution (either uniform (default) or Gaussianenabled
- true to enable or false to disablemultiplier
- a value between 0.0 and 0.5 (50%)public boolean isInitialized()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception