-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configuration information to the Opt tutorial #52
Comments
Would it also be possible to do a quick "how to use as stand alone library"? For myself I am an embedded systems guy and have zero experience with setting up Java projects (thanks to Android Studio). A problem another of my colleagues is also having as we are both very keen to use the framework but don't know where to start when it comes to building our own project. No doubt a trivial problem for an experienced java dev -_- |
Hi Alex, yes, I think it is a good idea to add this to the tutorial/documentation as well. Just as quick answer for you: To be sure that I understand you correctly: you want to integrate Opt4J as a dependency for a Java project, without the need to check out all the code in the repo. I think the most comfortable way to do this is a combination of gradle and jitpack. Jitpack allows you to use GitHub repos as dependencies. What you have to do is:
apply plugin: 'java' mainClassName = 'org.opt4j.core.start.Opt4J' group 'group' sourceCompatibility = 1.8 // necessary to use jitpack
} dependencies { You can use the website of JitPack to generate the dependency for a certain branch/commit/version. With a correct build file, gradle build eclipse will download the Opt4J libs and configure the project dependencies (not sure what you have to do for other editors, but it is probably similar). Hope that helps, just write us a message if you run into problems. P.S.: If you are interested in optimizing embedded systems, you may also want to checkout OpenDSE :) |
thanks for the quick reply. I like what you're saying as I am currently reading trough eclipse tutorials on buildship as well as the build.gradle file from the git repo. I will definable look into JitPack and see if I can get it working. I would also be happy to document this process (should i be successful) for this project. Also funny you should mention OpenDSE, I was reading papers and went through their documentation yesterday. Very cool but I think for my specific application (DVFS optimization for linux kernel states) Opt4j fits a little better. I shall post back on my progress, tomorrow this will be my only focus ;) thanks again for the help |
I just wanted to check this is correct, then I will write up a quick how-to for the HelloWorld tutorial outlined here as well as the test_config.xml.
Cheers |
oh and my build.gradle
|
Hi Alex, it is great that you want to contribute to the tutorial, thank you 😃 ! I have a paper deadline tomorrow, but I will have a careful look at the code + config first thing at Wednesday. Best regards, Fedor |
No worries,
good luck with the paper!
Cheers,
Alex
…On Mon, Nov 26, 2018 at 11:44 AM FedorSmirnov89 ***@***.***> wrote:
Hi Alex,
it is great that you want to contribute to the tutorial, thank you 😃 ! I
have a paper deadline tomorrow, but I will have a careful look at the code
+ config first thing at Wednesday.
Best regards,
Fedor
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AP6YnE9Ox4mg-tbPEy2KBWXFzqFK3Sm3ks5uy8YTgaJpZM4Yqpyb>
.
|
Hi Alex, just a quick question: what would you like to achieve inside the Hello World that you are describing? The current code will start up the configurator with the modules that you configured in the main(). When using the configurator, there is also a different workflow (this is the one that I, myself, prefer). If you have a project that uses Opt4J as dependency, you can just right-click it in the project viewer of Eclipse and go to Run -> Run as Java application. Eclipse will then ask you what class it should use. You can then select Opt4J and hit the OK button. The tutorial part where a complete optimization is started directly from Java code is, at least from my perspective, intended for the situation where you want to run an optimization within your program and directly get the optimization results, without going to the configuration GUI. |
Hi Fedor, I hope your paper deadline was met. I simply want to run the hello world code from the tutorial (The creator, decoder, evaluator and module) in a stand along java project such that every time I do not need to go into the gui and select all the various things. Essentially a script style program. What would be the easiest way to achieve this when implementing my own creator, decoder and evaluator? Thanks for your continued help. |
Yeah, the deadline worked out, thank you :) Just to mention it: In the code example you give above, you are actually not running the HelloWorld from the tutorial. Instead, you configure the ZDT benchmark as the used problem model. Concerning the easiest way for an own creator, decoder and evaluator: The answer depends on your workflow. If you want sth that is more script-like, you can define a gradle task that will create a fatJar containing your Java project (with your evaluator, creator and other classes) as well as its dependencies (in particular Opt4J). At least for the start, I would recommend to work from within Eclipse. Following steps should help you to get a feeling for the framework and its classes.
Feel free to write if you run into problems. |
Ahhh yes, I actually implemented both Hello World then out of curiosity I implemented the ZDT benchmark as well. I will have a play around with your suggestions, they make sense and seem like a less-fuss approach. Thanks for the advice! |
Although the information about the configuration is already both on the website and the tutorial document, I think we could make it more prominent (my students also tend to miss it). We could add a short step-by-step instruction (with screenshots and an explanation of the different parts of the Opt4J Gui) how a minimal exploration can be started to the beginning of the tutorial.
The text was updated successfully, but these errors were encountered: