experiments in model and firm py

This commit is contained in:
2023-05-15 18:18:41 +08:00
parent a5f278c4cb
commit 839e47cf0b
10 changed files with 90 additions and 41 deletions

11
orm.py
View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from sqlalchemy import create_engine, inspect
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import (Column, Integer, String, ForeignKey, BigInteger,
from sqlalchemy import (Column, Integer, DECIMAL, String, ForeignKey, BigInteger,
DateTime, PickleType, Boolean, Text)
from sqlalchemy.sql import func
from sqlalchemy.orm import relationship, Session
@@ -53,7 +53,16 @@ class Experiment(Base):
# variables
dct_lst_init_remove_firm_prod = Column(PickleType, nullable=False)
g_bom = Column(Text(4294000000), nullable=False)
n_max_trial = Column(Integer, nullable=False)
crit_supplier = Column(DECIMAL(8, 4), nullable=False)
firm_pref_request = Column(DECIMAL(8, 4), nullable=False)
firm_pref_accept = Column(DECIMAL(8, 4), nullable=False)
netw_pref_cust_n = Column(DECIMAL(8, 4), nullable=False)
netw_pref_cust_size = Column(DECIMAL(8, 4), nullable=False)
cap_limit = Column(Integer, nullable=False)
diff_new_conn = Column(DECIMAL(8, 4), nullable=False)
diff_remove = Column(DECIMAL(8, 4), nullable=False)
sample = relationship(
'Sample', back_populates='experiment', lazy='dynamic')