File size: 713 Bytes
1987ae5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pathlib
import time
from model.Configuration import Configuration
from algorithm.NsgaII import NsgaII
import streamlit as st

from HtmlOutput import HtmlOutput


def main(file_name):
    start_time = int(round(time.time() * 1000))
    configuration = Configuration()
    target_file = str(pathlib.Path().absolute()) + file_name
    configuration.parseFile(target_file)
    alg = NsgaII(configuration)
    # alg = Hgasso(configuration)
    alg.run()
    html_result = HtmlOutput.getResult(alg.result)
    # st.markdown(html_result, unsafe_allow_html=True)
    seconds = (int(round(time.time() * 1000)) - start_time) / 1000.0
    st.write("\nCompleted in {} secs.\n".format(seconds))
    return html_result