Skip to content

Python framework to perform 3D economic simulations

License

Notifications You must be signed in to change notification settings

flokapi/ecofaber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Linux

sudo apt-get install python3-pyqt5.qtopengl freeglut3-dev
pip3 install ecofaber

Windows

pip3 install ecofaber

Example

Example1.py

import numpy as np

import ecofaber
import ecofaber.basemodel as bm


@bm.register
class Model(bm.ModelElement):
    def __init__(self, data=None):
        super().__init__(data)

        self.angle = 0

    def update(self):
        self.angle += 0.1

    def getView(self):
        view = []

        view.append({
            "name": "b_cube_1",
            "pos": [10*np.cos(self.angle),10*np.sin(self.angle),0], 
            "color": [200,100,0],
        })

        view.append({
            "name": "b_ring_3",
            "pos": [0,0,0], 
            "color": [200,100,0],
        })

        return view

    def getObj(self, pos):
        return None


ecofaber.launch(Model)

Execute the following code

git clone [email protected]:flokapi/ecofaber.git
cd ecofaber/example
python3 example1.py

This will open the application with the model. You can now start the simulation, control the speed, the view, ...

example_screenshot

About

Python framework to perform 3D economic simulations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages