$darkmode
DENOPTIM
Behavior.java
Go to the documentation of this file.
1/*
2 * DENOPTIM
3 * Copyright (C) 2022 Marco Foscato <marco.foscato@uib.no>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package denoptim.main;
20
21
22import org.apache.commons.cli.CommandLine;
23
24import denoptim.main.Main.RunType;
25
30public class Behavior
31{
35 protected String helpMsg = "";
36
40 protected String errorMsg = "";
41
46 protected int exitStatus = 0;
47
51 protected RunType runType = null;
52
56 protected CommandLine cmd = null;
57
58//------------------------------------------------------------------------------
59
67 public Behavior(RunType runType, CommandLine cmd, int exitStatus,
68 String helpMsg, String errorMsg)
69 {
70 this.helpMsg = helpMsg;
71 this.errorMsg = errorMsg;
72 this.exitStatus = exitStatus;
73 this.runType = runType;
74 this.cmd = cmd;
75 }
76
77//------------------------------------------------------------------------------
78
84 public Behavior(RunType runType, CommandLine cmd)
85 {
86 this(runType, cmd, 0, null, null);
87 }
88
89//------------------------------------------------------------------------------
90
91}
Represents the behavior of the program at start-up.
Definition: Behavior.java:31
RunType runType
The type of run that is requested.
Definition: Behavior.java:51
Behavior(RunType runType, CommandLine cmd, int exitStatus, String helpMsg, String errorMsg)
Creates a behavior.
Definition: Behavior.java:67
String errorMsg
The error message.
Definition: Behavior.java:40
CommandLine cmd
The parsed command line arguments.
Definition: Behavior.java:56
Behavior(RunType runType, CommandLine cmd)
Creates a behavior.
Definition: Behavior.java:84
int exitStatus
A non-zero value means some error has occurred and the program will terminate.
Definition: Behavior.java:46
String helpMsg
The help message.
Definition: Behavior.java:35
Types of runs that can be requested to the DENOPTIM Main class.
Definition: Main.java:62