Commit 54b10fa5 authored by LIGNEUL CLEMENT's avatar LIGNEUL CLEMENT
Browse files

Merge branch 'Develop' into 'master'

Enhanced version

See merge request !5
parents 9f3ae599 57320602
......@@ -3,5 +3,4 @@ dist/
deploy/
node_modules/
package-lock.json
plotting/
EASEA-compiler-app/
\ No newline at end of file
EASEA-compiler-app/
This application is under the "Creative Commons
Attribution - Non Commercial 4.0 International" license
To get a copy of this license, please consult:
https://creativecommons.org/licenses/by-nc/4.0/
------------------------------------------------------
Cette application est placée sous licence "Creative Commons
Attribution - Pas d’Utilisation Commerciale 4.0 - International"
Pour accéder à une copie de cette licence, merci de vous rendre à
l'adresse suivante :
https://creativecommons.org/licenses/by-nc/4.0/deed.fr
# colors
_GREEN=$'\x1b[32m'
_END=$'\x1b[0m'
# get Os
UNAME:=$(shell uname)
install:
@echo "\n##### Install modules #####\n"
@echo "\n##### Installing the modules #####\n"
npm install
@echo "\n##### Start the packaging #####\n"
@echo "\n##### Beginning of the packaging #####\n"
@echo "\n##### Initialization #####\n"
......@@ -11,6 +18,16 @@ install:
npx nodegui-packer --init EASEA-compiler-app
@echo "\n##### Adding additional files #####\n"
ifeq ($(UNAME), Linux)
cp -rf src/plot.py src/3D_plot.py documentation/ deploy/linux/EASEA-compiler-app/
endif
ifeq ($(UNAME), Darwin)
cp -rf src/plot.py src/3D_plot.py documentation/ deploy/darwin/EASEA-compiler-app/
endif
@echo "\n##### Build dist #####\n"
npm run build
......@@ -18,25 +35,29 @@ install:
@echo "\n##### Packaging in progress #####\n"
npx nodegui-packer --pack ./dist
@echo "\n##### Copy additional files #####\n"
find 'deploy/' -type d -name doc | sed 's/doc//' | xargs -n 1 cp -v src/plot.py
find 'deploy/' -type d -name doc | sed 's/doc//' | xargs -n 1 cp -v src/3D_plot.py
find 'deploy/' -type d -name doc | sed 's/doc//' | xargs -n 1 cp -rv documentation/
ifneq ($(TYPE), DEV)
find 'deploy/' -type d -name doc | sed 's/doc//' | xargs -n 1 cp -rt ./
rm -rf deploy/
endif
# else keep the deploy dir
rm -rf deploy/ dist/
mv EASEA-compiler-app/*.AppImage EASEA-compiler-app/easea-compiler-app
rm -f EASEA-compiler-app/documentation/interactive*
@echo "\n##### Packaging finished #####\n"
@echo "\n##### Installing executable #####\n"
sudo cp EASEA-compiler-app/easea-compiler-app /bin
@printf "\033[32m\n##### Installation complete #####\n\n\033[0m"
update-documentation:
asciidoctor documentation/*.adoc
clean:
rm -rf deploy dist EASEA-compiler-app
\ No newline at end of file
uninstall:
rm -rf deploy dist EASEA-compiler-app
@echo "\n##### Uninstalling executable #####\n"
sudo rm -rf /bin/easea-compiler-app
@printf "\033[32m\n##### Uninstallation completed #####\n\n\033[0m"
# EASEA-compiler-app
This application is a graphical interface for the [ESEA](http://easea.unistra.fr/index.php/EASEA_platform) platform.
This application is a graphical interface for the [EASEA](http://easea.unistra.fr/index.php/EASEA_platform) platform.
## Dependencies
This application has been designed and tested on Ubuntu 20.10
This application has been designed and tested on Ubuntu 20.10 with nodejs v16.8.0
To use this program, it is necessary to have installed the most recent version of EASEA (see http://easea.unistra.fr/index.php/Downloading_EASEA)
......@@ -20,33 +20,30 @@ To use this program, it is necessary to have installed the most recent version o
- kaleido to export graphs :
- With pip : `pip install kaleido`
- With conda : `conda install -c conda-forge python-kaleido`
### Linux dependencies
- Make, GCC v7
- CMake 3.1 or later
- Node.JS version 12 or later
- [QT5](https://www.qt.io/qt5-11) or later
### macOS dependencies
- macOS 10.10 or later (OS 64 bits only)
- Make, GCC v7
- CMake 3.1 or later
- Node.JS version 12 or later
## Installation
- Clone this repository
- Run `make install` in `easea-compiler-app/`
- The executable is located in `EASEA-compiler-app/`
- To remove the generated executable use `make clean`
- Run `sudo make install` in `easea-compiler-app/`
- To run the application run the executable in `EASEA-compiler-app/easea-compiler-app` or run `easea-compiler-app` if the command is installed
- To remove the generated executable use `make uninstall`
(DEV) To run the application execute `npm start`
---
## Next features
- See all results after the runs
- Analyze and repair csv files to fix the bug on very fast runs (<1s)
- Gitlab pages for documentation ?
- Gitlab pages for documentation
---
## Contact
If you have any questions you can send an email to clement.ligneul@etu.unistra.fr
\ No newline at end of file
= EASEA Compiler App Documentation
Clément Ligneul <clement.ligneul@etu.unistra.fr>
v1.1 2021-07-21
v1.3 2021-09-12
:toc: left
:toclevels: 4
:hide-uri-scheme:
......@@ -42,6 +42,9 @@ To plot your results, you need to install :
* with pip : `pip install kaleido`
* with conda : `conda install -c conda-forge python-kaleido`
- Qt :
* https://www.qt.io/qt5-11[QT5, window=_blank] or later is recommended
Note that if you are using macOS, plotly only works on version 10.10 or more (OS 64 bits).
......@@ -50,9 +53,9 @@ Note that if you are using macOS, plotly only works on version 10.10 or more (OS
Once the dependencies are installed :
- clone https://git.unistra.fr/ligneul/easea-compiler-app[this repository, window=_blank]
- run `npm install` in the main directory
- compile this app running `make` in the main directory
- run the executable in `EASEA-compiler-app/`
- run `make install` in the main directory
- now you can run the executable in `EASEA-compiler-app/` named `easea-compiler-app`. If the executable is installed, you can also run `easea-compiler-app` from anywhere
- run `make uninstall` in the main directory to uninstall the application
== Dev version
......@@ -66,7 +69,7 @@ In this tutorial we will compile and run the file `weierstrass.ez` from the `/ex
==== Compilation
. In the compile tab load `easea/examples/weierstrass.ez`
. In the compile tab load `easea/examples/weierstrass/weierstrass.ez`
. We don't use any options in this compilation so just click on the `Compile` button
. After clicking on this button you see this :
......@@ -262,6 +265,18 @@ image::images/island_menu.png[island menu image, 300, align=center]
- [underline]#Evaluate Immigrants# : ...
==== See Results
When all the runs are finished, a new button appears. It allows you to see the results of the different runs. This function is available only for non <<Multi-objective problems, multi-objective problems>>.
image::images/end_run_batch.png[end run in batch image, 800, align=center]
image::images/results_1.png[results 1 image, 800, align=center]
To see another run result, use the slider :
image::images/results_6.png[results 6 image, 800, align=center]
=== Result Plot tab
After all the runs, if there is no problem during the execution, the application will generate a graph according to your compilation options.
......@@ -361,4 +376,12 @@ If you use one of these options do not run in batch because the results will be
- If the run takes a long time, set "Time limit" option to 0 to have complete execution
- You can go to the EASEA website with the help menu. You can find a lot of useful information in this site like description of the compilation parameters
- The usual shortcuts are available here like ctrl+tab to switch of tab, tab and shift+tab to change focus etc...
- If you launch the executable from a terminal you can see more debug information
\ No newline at end of file
- If you launch the executable from a terminal you can see more debug information
== License
This application is under the "Creative Commons
Attribution - Non Commercial 4.0 International" license
To get a copy of this license, please consult:
https://creativecommons.org/licenses/by-nc/4.0/[window=_blank]
\ No newline at end of file
This diff is collapsed.
= EASEA Compiler App Documentation
Clément Ligneul <clement.ligneul@etu.unistra.fr>
v1.1 2021-07-21
v1.3 2021-09-12
:toc: left
:toc-title: Table des matières
:toclevels: 4
......@@ -35,16 +35,19 @@ Pour générer le graphe des résultats vous devez installer :
* avec pip : `pip install kaleido`
* avec conda : `conda install -c conda-forge python-kaleido`
Notez que plotly ne fonctionne qu'à partir de la version 10.10 sur macOS (64 bit seulement).
- QT :
* https://www.qt.io/qt5-11[QT5, window=_blank] est recommandé
Notez que plotly ne fonctionne qu'à partir de la version 10.10 de macOS (64 bit seulement).
== Installation
Une fois les dépendances installées :
- clonez https://git.unistra.fr/ligneul/easea-compiler-app[ce dépôt, window=_blank]
- exécutez `npm install` dans le repertoire principal
- compilez l'exécutable avec `make` dans le répertoire principal
- lancez l'exécutable du répertoire `EASEA-compiler-app/`
- exécutez `sudo make install` dans le repertoire principal
- vous pouvez maintenant lancer l'application avec l'exécutable `easea-compiler-app` dans le répertoire `EASEA-compiler-app/`. Si l'exécutable est installé vous pouvez lancer l'application avec la commande `easea-compiler-app` depuis n'importe où.
- pour désinstaller l'application faites `make uninstall` depuis le répertoire principal
== Version développeur
......@@ -58,7 +61,7 @@ Dans ce tutoriel nous allons simplement compiler et exécuter le fichier `weiers
==== Compilation
. Dans l'onglet `Compile` chargez le fichier `easea/examples/weierstrass.ez`
. Dans l'onglet `Compile` chargez le fichier `easea/examples/weierstrass/weierstrass.ez`
. Nous n'utilisons aucune option pour cette compilation, cliquez donc directement sur `Compile`
. Après avoir lancé la compilation vous devez voir ceci :
......@@ -251,6 +254,18 @@ image::images/island_menu.png[island menu image, 300, align=center]
- [underline]#Evaluate Immigrants# : Réévaluer les individus migrants
==== See Results
Quand toutes les exécutions d'un batch sont terminées, un nouveau boutton apparaît. Il permet de consulter le resultat pour chacunes d'entre elles. Cette fonction n'est pas disponible pour des exécution sur des <<Problèmes multi-objectifs, problèmes multi-objectifs>>.
image::images/end_run_batch.png[end run in batch image, 800, align=center]
image::images/results_1.png[results 1 image, 800, align=center]
Pour voir les différents résultats, utilisez le curseur :
image::images/results_6.png[results 6 image, 800, align=center]
=== Onglet Result Plot
A la fin de toutes les exécutions, si aucune erreur n'est survenue, cette application va générer un graphe en fonction des paramètres de compilation utilisés.
......@@ -354,3 +369,13 @@ Si vous utilisez l'une de ces options ne faites pas d'exécution en batch car le
- Les raccourcis courants fonctionnent dans l'application (ctrl+tab pour changer d'onglet, tab et shift+tab pour changer le focus etc...)
- Si vous lancez l'exécutable de l'application depuis un terminal vous pouvez voir des informations utiles en cas de problèmes
== Licence
Cette application est placée sous licence "Creative Commons
Attribution - Pas d’Utilisation Commerciale 4.0 - International"
Pour accéder à une copie de cette licence, merci de vous rendre à
l'adresse suivante :
https://creativecommons.org/licenses/by-nc/4.0/deed.fr[window=_blank]
\ No newline at end of file
This diff is collapsed.
......@@ -12,20 +12,19 @@
"update-modules": "ncu -u && npm install"
},
"dependencies": {
"@nodegui/nodegui": "^0.31.0",
"opn": "^6.0.0"
"@nodegui/nodegui": "^0.34.0",
"open": "^6.0.0"
},
"devDependencies": {
"@nodegui/packer": "^1.4.1",
"@types/fs-extra": "^9.0.11",
"@types/node": "^15.12.4",
"@types/fs-extra": "^9.0.12",
"@types/node": "^16.4.1",
"clean-webpack-plugin": "^3.0.0",
"file-loader": "^6.2.0",
"native-addon-loader": "^2.0.1",
"ts-loader": "^9.2.3",
"typedoc": "^0.21.4",
"typescript": "^4.3.5",
"webpack": "^5.40.0",
"webpack": "^5.46.0",
"webpack-cli": "^4.7.2"
}
}
......@@ -3,33 +3,35 @@ import os
from pandas.io.parsers import read_csv
import sys
# arguments [nb_gen, nb_plots, csv_file, title, f1, f2, f3]
# arguments [nb_gen, nb_plots, csv_file, title, f1, f2, f3]
if len(sys.argv) != 8:
print(
"Usage : " + sys.argv[0] + " <nb of generations> <nb of plots> <csv file> <title> <f1> <f2> <f3>",
"Usage : "
+ sys.argv[0]
+ " <nb of generations> <nb of plots> <csv file> <title> <f1> <f2> <f3>",
file=sys.stderr,
)
exit(1)
if sys.argv[4] :
if sys.argv[4]:
titre = sys.argv[4]
else :
else:
titre = "Results"
if sys.argv[5] :
if sys.argv[5]:
name_x = sys.argv[5]
else :
else:
name_x = "f1"
if sys.argv[6] :
if sys.argv[6]:
name_y = sys.argv[6]
else :
else:
name_y = "f2"
if sys.argv[7] :
if sys.argv[7]:
name_z = sys.argv[7]
else :
else:
name_z = "f3"
df = read_csv(
......@@ -40,9 +42,7 @@ fig = px.scatter_3d(
df, x="f1", y="f2", z="f3", color="f2", size="f3", size_max=18, opacity=0.7
)
fig.update_traces(
marker_colorbar_title_text=name_y
)
fig.update_traces(marker_colorbar_title_text=name_y)
fig.update_layout(
title=titre,
......@@ -75,6 +75,6 @@ fig.update_layout(
),
)
fig.write_html("plotting/fig.html")
fig.write_html("/tmp/plotting/fig.html")
fig.write_image("plotting/fig.svg", engine="kaleido", scale=2)
fig.write_image("/tmp/plotting/fig.svg", engine="kaleido", scale=2)
......@@ -263,6 +263,11 @@ export class Compile {
compile_btn.setEnabled(true);
option_widget.setEnabled(true);
compiling_label.hide();
if (this.nsgaii || this.nsgaiii || this.asrea || this.ibea || this.cdas) {
run_obj.plot_type = '3D';
} else {
run_obj.plot_type = '2D';
}
});
} else {
......@@ -290,7 +295,7 @@ export class Compile {
var ez_makefile = this.ez_file_address.substring(0, this.ez_file_address.length - 2);
ez_makefile = ez_makefile.concat('mak');
var make_clean = output_compile.compile('make', ['-C', this.dir_path, '-f', ez_makefile, 'easeaclean']);
make_clean.stdout.on('data', (data) => {
output_compile.text.insertPlainText(data.toString());
});
......
// index.ts
import { QTabWidget, QIcon, QMainWindow, QWidget, WidgetEventTypes, QMenu } from '@nodegui/nodegui';
import { spawn, ChildProcess } from 'child_process';
import { Compile } from './compile_tab';
......@@ -94,15 +92,14 @@ global_win.setStyleSheet(general_css);
// call at the end
global_win.addEventListener(WidgetEventTypes.Close, () => {
// console.log("On kill tout ici");
util.kill_all(running_proc);
fs.rmSync('./plotting', { recursive: true, force: true });
fs.rmSync('/tmp/plotting', { recursive: true, force: true });
});
// global_win.adjustSize();
// global_win.setFixedSize(global_win.size().width(), global_win.size().height());
global_win.adjustSize();
global_win.setFixedSize(global_win.size().width(), global_win.size().height());
fs.mkdir('plotting/', (err) => {
fs.mkdir('/tmp/plotting/', (err) => {
if (err && err.code !== 'EEXIST') {
console.log(err.message);
console.log(err);
......@@ -112,4 +109,4 @@ fs.mkdir('plotting/', (err) => {
global_win.show();
(global as any).global_win = global_win;
(global as any).global_win = global_win; // for garbage collector
import { Direction, QBoxLayout, QDialog, QCheckBox, QPushButton, QWidget, QLabel, QFileDialog, WindowType, FileMode } from "@nodegui/nodegui";
import { Direction, QBoxLayout, QDialog, QCheckBox, QPushButton, QWidget, QLabel, QFileDialog, WindowType, FileMode, QShortcut, QKeySequence } from "@nodegui/nodegui";
import { Advanced_option_widget } from "./advanced_option_widget";
import { general_css } from "./style";
import * as util from './utilities';
......@@ -21,6 +21,8 @@ export class Island_options_win {
this.migration_proba = NaN;
this.ip_file = '';
util.disable_keys('Escape', this.window);
const main_layout = new QBoxLayout(Direction.TopToBottom);
const reevaluate_im = new QCheckBox();
......
......@@ -2,7 +2,7 @@ import { Direction, QBoxLayout, QComboBox, QDialog, QPushButton, QWidget, Window
import { Advanced_option_widget } from "./advanced_option_widget";
import { general_css } from "./style";
import { print_errors } from "./utilities";
import * as util from './utilities';
export class Offspring_options_win {
window: QDialog
......@@ -23,6 +23,8 @@ export class Offspring_options_win {
this.size_off = NaN;
this.surviving_off_type = '#';
util.disable_keys('Escape', this.window);
const main_layout = new QBoxLayout(Direction.TopToBottom);
const nb_off = new Advanced_option_widget('Offspring Size :', 0);
......
......@@ -21,6 +21,8 @@ export class Parent_options_win {
this.reduce_pressure = 2.0;
this.surviving_parent_type = '#';
util.disable_keys('Escape', this.window);
const main_layout = new QBoxLayout(Direction.TopToBottom);
const surviving_parent = new Advanced_option_widget('Surviving Parents :', 0)
......
......@@ -5,11 +5,12 @@ import plotly.graph_objects as go
import sys
from math import ceil
# parameters = [nb_gen, nb_plots, title]
# parameters = [nb_gen, nb_plots, title]
if len(sys.argv) != 4:
print(
"Usage : " + sys.argv[0] + " <nb of generations> <nb of plots>", file=sys.stderr
"Usage : " + sys.argv[0] + " <nb of generations> <nb of plots> <title>",
file=sys.stderr,
)
exit(1)
......@@ -22,20 +23,20 @@ nb_plots = int(sys.argv[2])
# plot title
if sys.argv[3]:
titre = sys.argv[3]
else :
else:
titre = "Results"
treshold = ceil(nb_gen / nb_plots)
df = read_csv("plotting/data.csv")
df = read_csv("/tmp/plotting/data.csv")
fig = go.Figure()
for i in range(1, nb_plots + 1):
if i == nb_plots:
n = "≤" + str((i) * treshold)
else :
else:
n = "<" + str((i) * treshold)
fig.add_trace(
......@@ -65,6 +66,6 @@ fig.update_xaxes(title_text="Generations")
fig.update_yaxes(title_text="Best Fitness")
fig.write_html("plotting/fig.html")
fig.write_html("/tmp/plotting/fig.html")
fig.write_image("plotting/fig.svg", engine="kaleido", scale=2)
fig.write_image("/tmp/plotting/fig.svg", engine="kaleido", scale=2)
import fs from 'fs';
export const data_csv = 'plotting/data.csv';
export const data_csv = '/tmp/plotting/data.csv';
export function parser(data: string): number[][] {
var str = data.toString()
......@@ -65,7 +65,6 @@ export function write_in_file(buffer: string) {
}
var init_buf = 'GEN,TIME,PLAN_EVAL,ACTU_EVAL,BEST_FIT,AVG_FIT,WORST_FIT,STD_DEV';
fs.writeFileSync(fd, init_buf);
fs.writeFileSync(fd, '\n' + buffer);
fs.writeFileSync(fd, init_buf + '\n' + buffer);
fs.closeSync(fd);
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment