Giter Club home page Giter Club logo

nick88msn / cmfg Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 237 KB

Phd Program in Big Data Management @UNISA (University of Salerno). Phd Project on Cloud Manufacturing. Here you can find a little prototype in Python to simulate a Distributed Manufacturing Network. Built with Mesa.

Home Page: https://scholar.google.com/citations?user=ZgPPSFkAAAAJ&hl=en&authuser=1

Python 100.00%
cloudmanufacturing multiagent-systems multiobjective-optimization nicola-mastrandrea phd-dissertation phd-project phd-thesis scheduling-problem

cmfg's People

Contributors

nick88msn avatar

Watchers

 avatar

cmfg's Issues

Add services to the Dashboard

Add services info such as:

  • A table with services info (time to deliver, costs, nodes involved in the schedule, quantities, prices, machien time, status flag)
  • Dropdown menu with all services id
  • Gantt with schedule and times
  • Add services marker

Optimize Python functions and calls

  • Add cProfile to functions and reducing runtime
import cProfile

RUN_SERVER = False

    while True:
        #cProfile.run("model.step()")
        model.step()
        node_managers = model.datacollector.get_agent_vars_dataframe()

Add node info and KPIs to the Dashbaord UI

  • Add Node to the dashboard

#Frontend
    app.layout = html.Div(children=[
        html.H1('Dashboard'),
        html.Div(id = 'widgets', children=[
            html.H4(f'No. nodes: {len(nodes)}'),
            html.H4(f'Area width: {model_width} km'),
            html.H4(f'Area height: {model_height} km')
        ]),
        html.Div(id = 'mapbox', children=[]),
        dcc.Interval(id='map-update', interval= 5 * UPDATE_INTERVAL * 1000),
        dcc.Tabs(id='tabs-home', children=[
            dcc.Tab(label="Platform", children=[
                        html.Div(id = 'capacity-graph-div', children=[]),
                        html.Div(id = 'service-analysis-div', children=[]),
                        html.Div(id = 'order-analysis-div', children=[]),
                        html.Div(id = 'completed-order-div', children=[]),
                        html.Div(id = 'completed-capacity-div', children=[])
            ]),
            dcc.Tab(label="Nodes", children=[])
        ]),
        dcc.Interval(id='graph-update', interval= UPDATE_INTERVAL * 1000),
        # hidden signal value
        html.Div(id='signal', style={'display': 'none'})  
    ])

  • Explore dataframe from node manager datacollector:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
ID Location Full Capacity ... Tasks queue Running Tasks Completed Tasks
Step AgentID ...
1 (13, 10) node_b7e66c64-8faa-4bbf-848c-41ebf36c7b57 (13, 10) 10 ... 0 0 0
(13, 19) node_f8a023db-7cc0-4564-9622-dc587b8e83f3 (13, 19) 1 ... 0 0 0
(17, 14) node_231183df-0a08-41e3-9dc6-94767f87e3da (17, 14) 8 ... 0 0 0
(10, 11) node_70d54280-0642-419f-b712-3e7e3c995be7 (10, 11) 1 ... 0 0 0
(18, 19) node_d6a43fce-c6ef-41a8-b1e1-7f56841b629f (18, 19) 4 ... 0 0 0

Add services position to the map

Add yellow triangle for services adding a trace to the mapbox figure

  • Handle Service Status assigning different color and sizes (based on quantities requested and processed)

  • Put only WIP services and new orders. Create a different map for archived (completed and rejected ones)

`@app.callback(Output('mapbox', 'children'), [Input("map-update", "n_intervals")])
def updateMap(_):
#MAP
map_fig = go.Figure()
global latitudes, longitudes, sizes
capacities, labels = query_nodes()

    #Actual Map
    map_fig.add_trace(go.Scattermapbox(
                lat=latitudes,
                lon=longitudes,
                mode='markers',
                marker=go.scattermapbox.Marker(
                    size=sizes,
                    color='red'
                ),
                text=labels,
                hoverinfo='text'
            )
    )

    map_fig.add_trace(go.Scattermapbox(
                lat=latitudes,
                lon=longitudes,
                mode='markers',
                marker=go.scattermapbox.Marker(
                    size=capacities,
                    color='#ffffff',
                    opacity=0.7
                ),
                hoverinfo='none',
            ))
    
    map_fig.update_layout(
            showlegend = False,
            hovermode='closest',
            #autosize = False,
            #width = 500,
            #height = 500,
            title='Manufacturing Network',
            uirevision= False,
            mapbox=dict(
                accesstoken=mapbox_access_token,
                bearing=0,
                center=go.layout.mapbox.Center(
                    lat=origin[0],
                    lon=origin[1]
                ),
                pitch=0,
                zoom=9
            )
    )

    map_graph = dcc.Graph(id='plot', figure=map_fig)

    return map_graph`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.