heal-research / HeuristicLab

HeuristicLab - An environment for heuristic and evolutionary optimization
https://dev.heuristiclab.com
GNU General Public License v3.0
39 stars 16 forks source link

Add support for command line arguments #1926

Closed HeuristicLab-Trac-Bot closed 11 years ago

HeuristicLab-Trac-Bot commented 12 years ago

Issue migrated from trac ticket # 1926

milestone: HeuristicLab 3.3.8 | component: PluginInfrastructure | priority: low | resolution: done

2012-09-04 10:15:45: @jkarder created the issue


There should be a way to pass and handle command line arguments in HeuristicLab, e.g. an argument like /start:Optimizer could automatically start the Optimizer.

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-04 10:16:26: @jkarder changed status from new to accepted

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-04 10:34:59: @jkarder commented


r8563:

  • created argument handling infrastructure
  • added StartArgument
HeuristicLab-Trac-Bot commented 12 years ago

2012-09-04 10:45:03: @jkarder commented


It is now possible to automatically start applications using the StartArgument. The syntax is as follows:

  • /start:ApplicationName

Examples:

  • /start:Optimizer
  • /start:"Persistence Configuration"
HeuristicLab-Trac-Bot commented 12 years ago

2012-09-04 10:45:14: @jkarder changed owner from @jkarder to @Shabbafru

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-04 10:45:14: @jkarder changed status from accepted to reviewing

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-05 10:00:59: @gkronber commented


We have a very old ticket for this #45 (which I have just closed as duplicate).

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-05 10:05:15: @jkarder commented


Replying to [comment:5 gkronber]:

We have a very old ticket for this #45 (which I have just closed as duplicate).

Oh, I missed that one. Thanks!

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-20 23:36:46: @Shabbafru commented


Thanks very much for implementing this, here are my reviewing comments:

  • The white space in the regex should be replaced with \s
  • GetArguments in the ArgumentHandling class should throw an exception if the argument is not valid or null so that the user gets notified if there is a problem with the argument
  • The StartToken string should be moved to the StartArgument class so that everything concerning this argument is in one place
  • Maybe this Token string should also be in the interface as all arguments will need one
  • Please remove the public StarterForm(string appName) method from the StarterForm class as it is not used anywhere
HeuristicLab-Trac-Bot commented 12 years ago

2012-09-20 23:36:46: @Shabbafru changed owner from @Shabbafru to @jkarder

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-20 23:36:46: @Shabbafru changed status from reviewing to assigned

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-21 14:42:25: @jkarder commented


r8677: refactored argument handling infrastructure based on the changes suggested by ascheibe in comment:7:#1926

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-21 14:45:55: @jkarder commented


Thanks for the review.

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-21 14:46:10: @jkarder changed owner from @jkarder to @Shabbafru

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-21 14:46:10: @jkarder changed status from assigned to reviewing

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-21 18:58:16: @Shabbafru commented


Thanks, looks good!

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-21 18:58:16: @Shabbafru changed owner from @Shabbafru to @jkarder

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-21 18:58:16: @Shabbafru changed status from reviewing to readytorelease

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-24 14:06:14: @Shabbafru commented


I'm reassigning this ticket to mkommend as he also wanted to have a look at it.

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-24 14:06:14: @Shabbafru changed owner from @jkarder to @mkommend

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-24 14:06:14: @Shabbafru changed status from readytorelease to reviewing

HeuristicLab-Trac-Bot commented 12 years ago

2012-09-27 20:59:15: @abeham commented


I wondered if we could have a way to hide the starter. Can you omit showing the starter if the /start command is given? I think we don't really need to show it in this case.

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-04 10:03:35: @mkommend commented


Reviewing comments:

  • Argument.GetHashCode() is strangely implemented. Normally it should reflect the implementation of Equals.
  • A better name for the folder containing the files would be CommandLineArguments or CommandLineArgumentHandling. ArgumentHandling is little bit too generic IMHO.
  • Why was it decided to implement command line parsing manually and not use existing libraries, that provide more functionality? (e.g., http://stackoverflow.com/questions/491595/best-way-to-parse-command-line-arguments-in-c)
  • Please address the comment by abeham.
HeuristicLab-Trac-Bot commented 12 years ago

2012-10-04 10:03:35: @mkommend changed owner from @mkommend to @jkarder

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-04 10:03:35: @mkommend changed status from reviewing to assigned

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:14:56: @jkarder commented


r8748:

  • addressed the suggestion by abeham in comment:13:#1926
  • applied the changes suggested by mkommend in comment:14:#1926
  • refactored argument handling infrastructure
HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:15:13: @jkarder changed status from assigned to accepted

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:16:19: @jkarder commented


Thanks for the detailed review. It is now possible to hide the starter by using the HideStarterArgument (/hideStarter).

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:16:38: @jkarder changed owner from @jkarder to @mkommend

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:16:38: @jkarder changed status from accepted to reviewing

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:42:15: @jkarder changed owner from @mkommend to @jkarder

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:42:15: @jkarder changed status from reviewing to assigned

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:42:20: @jkarder changed status from assigned to accepted

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:43:50: @jkarder commented


r8749: made generic type parameter in ICommandLineArgument<T> invariant

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:43:57: @jkarder changed owner from @jkarder to @mkommend

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-05 17:43:57: @jkarder changed status from accepted to reviewing

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-14 20:53:53: @jkarder changed owner from @mkommend to @jkarder

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-14 20:53:53: @jkarder changed status from reviewing to assigned

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-17 21:32:54: @jkarder changed status from assigned to accepted

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-17 21:46:12: @jkarder commented


r8818:

  • added OpenArgument
  • refactored argument handling infrastructure
HeuristicLab-Trac-Bot commented 12 years ago

2012-10-17 21:50:02: @jkarder uploaded file CommandLineArgumentHandlingRegistryEntries.reg (0.9 KiB)

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-17 21:51:11: @jkarder commented


All valid command line arguments are now passed to any started application through the PluginManager and the ApplicationManager to enable specific handling. As a result it is now possible to load saved HeuristicLab files via command line arguments. A new instance of the Optimizer will be started automatically and the files will be opened. I also attached the [attachment:CommandLineArgumentHandlingRegistryEntries.reg registry entries] needed to associate HeuristicLab files with HeuristicLab. Keep in mind that you probably have to change the specified path to the HeuristicLab executable.

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-18 08:49:43: @Shabbafru commented


r8819 updated slave app to work with the changes of r8818

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-18 08:56:14: @jkarder commented


r8820: updated DataImporter and MetaOptimization branches to work with the changes of r8818

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-18 14:30:42: @mkommend commented


Replying to [comment:25 jkarder]:

r8818:

  • added OpenArgument
  • refactored argument handling infrastructure In r8818 you introduced a command line property in the IMainForm interface, which should be removed as it is not needed and and command line arguments should not be handled be a form object.
HeuristicLab-Trac-Bot commented 12 years ago

2012-10-18 14:59:30: @jkarder commented


r8821: reverted the changes addressed by mkommend in comment:29:#1926

HeuristicLab-Trac-Bot commented 12 years ago

2012-10-18 15:00:41: @jkarder commented


Replying to [comment:29 mkommend]:

Replying to [comment:25 jkarder]:

r8818:

  • added OpenArgument
  • refactored argument handling infrastructure In r8818 you introduced a command line property in the IMainForm interface, which should be removed as it is not needed and and command line arguments should not be handled be a form object.

Thanks for the hint.

HeuristicLab-Trac-Bot commented 11 years ago

2012-11-21 18:56:42: @jkarder commented


r8934: refactored arguments

HeuristicLab-Trac-Bot commented 11 years ago

2012-11-21 18:56:52: @jkarder changed owner from @jkarder to @mkommend

HeuristicLab-Trac-Bot commented 11 years ago

2012-11-21 18:56:52: @jkarder changed status from accepted to reviewing

HeuristicLab-Trac-Bot commented 11 years ago

2012-11-29 12:48:16: @mkommend changed status from reviewing to readytorelease