Output from the
selected variant form of enterprise, whether state-owned,
township-village, urban collective, joint venture, private, or
other. Output defines the market(s) the firm competes within. Each
market has its own distinct rules (determined by the complex interaction
of central, provincial, and local government authority and the way these
authorities respond to international agreements such as WTO).
#The contents of this module form the "Kernel" of Class (the larger file,
super-classes, is available on request):
import random
class DirectProducers:
TotalLH = 0
StolenSurplus = 0
def PerformSL(self, LaborHours):
self.PerformedLH = LaborHours
self.TotalLH += LaborHours
self.necessary = random.randint(1, self.PerformedLH-1)
self.surplus = self.PerformedLH - self.necessary
class Appropriator:
pocket = 0
def AppropriateFrom(self, DirectProducers):
self.hands = DirectProducers.surplus
DirectProducers.surplus = 0
DirectProducers.StolenSurplus += self.hands
return self.hands
def DistributeTo(self, SubsumedClassAgent):
distribution = random.randint(1, self.hands)
SubsumedClassAgent.pocket += distribution
self.hands -= distribution
self.pocket += self.hands
self.hands = 0
class SubsumedClassAgent:
pocket = 0
class FundamentalClassProcess:
def __init__(self):
self.appropriator = Appropriator()
self.directproducer = DirectProducers()
self.subsumedclassagent = SubsumedClassAgent()
self.LaborHours = 0
def execute(self, RANDOM, MIN, MAX):
if RANDOM : self.LaborHours = random.randint(MIN, MAX)
else: self.LaborHours = int(raw_input())
self.directproducer.PerformSL(self.LaborHours)
AppSum = self.appropriator.AppropriateFrom(self.directproducer)
self.appropriator.DistributeTo(self.subsumedclassagent)
return "Labor Hours Performed:", self.LaborHours,\
"Total LH Performed:", self.directproducer.TotalLH,\
"Accumulated Necessary:", self.directproducer.necessary,\
"Appropriated Sum:", AppSum,\
"Appropriator's Accumulated Surplus:",
self.appropriator.pocket,\
"Total Stolen Surplus:",
self.directproducer.StolenSurplus,\
"SCagent Pocket:", self.subsumedclassagent.pocket
def run(self, HOWMANYTIMES=1, RANDOM=1, MIN=2, MAX=24, REPORT=0):
while HOWMANYTIMES>=1:
report = self.execute(RANDOM, MIN, MAX)
if REPORT==1: print "\n", report
HOWMANYTIMES -= 1
def testKernel():
MyFCP = FundamentalClassProcess()
MyFCP.run(HOWMANYTIMES=2, REPORT=1)
testKernel()
class enterprise_output:
# Properties:
# a list of -> type (A car, etc...)
# Sub Objects
# Methods pass Enterprises borrow
funds from banks and nonbank financial firms. The terms of loans are
variable, defined by a set of predetermined categories. However, the
easiest terms apply to state-owned enterprises only. The simulation model
is able to predict that state-owned enterprises will generally have higher
debt-asset ratios than other firms.
class borrowed_funds:
# Properties:
# currency
# amount
# Methods
#transfer pass Investments (or capital
budgeting) is a function of market growth rates, cost of capital,
stability (or lack thereof) of cash flow, government subsidies, and
competitive conditions.
class investments:
# Properties
# Sub Objects:
# data file
# Methods pass Expenses is, at the
moment, a hodge-podge of value expended for both fundamental production
activities and distributions from surplus value. In the next iteration of
the model these items may be split into two categories: representing
operational expenses and distributions from surplus value. At present, this category includes
social welfare expenses, such as health care, education, and food service,
as well as pensions. It also includes operational expenses, marketing
expenses, and a wide range of distributive payments from surplus value, as
well as manufacturing expenses (raw materials, depreciation of
technology).
class expenses:
# list of type expense
# methods:
# pay(ID)
# payall
# search class enterprise:
# Properties:
# surplus
# output type (what does the enterprise produce?)
# Sub Objects:
# investments (most likely a data file wrapped in a class
# funds
# borrowed funds
# retained cash flow
# equity
# enterprise_output
# board of directors
# marketing department
# money spent
# effectiveness
# methods:
# spend
# determine_effectiveness
# worker body
# worker salaries
# worker performance
# Methods:
# acquire workers
# fire workers
# acquire materials
# sell materials
# produce value
# organize the production
# organize the labor
# organize the materials
# realize value
# marketing, etc...
# distribute the surplus
# make an investment
# pay the workers
# pay management
# pay board of directors
# pay taxes
# pay off debt? pass class state_owned_enterprise(enterprise): # Portion
of surplus is given to the state
# Properties
# Sub Objects:
# Methods pass class state_controlled_enterprise(enterprise): # Run by
the State
# Properties
# Sub Objects:
# Methods pass class town_village_enterprise(enterprise):
# Properties
# Sub Objects
# Methods pass class joint_venture(foreign_enterprise,domestic_enterprise):
# Properties
# Sub Objects:
# Methods pass class domestic_private_enterprise(enterprise):
# Properties
# Sub Objects:
# Methods pass class foreign_private_enterprise(enterprise):
# Properties
# Sub Objects
# Methods pass class self_employed_producer(enterprise):
# Sub Objects
# Methods pass
# Properties
# Sub Objects
# Methods pass class agricultural_producer():
# Should it inherit from the enterprise class?
# Properties
# Sub Objects
# Methods class materials:
# Properties
# Sub Objects
# Methods pass class manager:
# Properties
# Sub Objects
# Methods pass class manager_pool:
# Properties
# Sub Objects
# Methods pass class worker:
# Properties
# Sub Objects
# Methods pass class worker_pool:
# Properties
# Sub Objects
# Methods pass class technology:
# Properties
# Sub Objects
# Methods pass class technology_pool:
# Properties
# Sub Objects
# Methods pass class policy:
# Properties:
# type (taxes, subsidies, labor policy, corporate responsibility, etc...)
# Sub Objects
# Methods pass class government_policy:
# Properties
# Sub Objects:
# national_policy
# local_policy
# provential_policy
# Methods pass class market:
# Properties
# Sub Objects
# Methods pass class markets:
# Properties
# Sub Objects:
# market agriculture
# market manufacture goods
# market services
# Methods pass class bank: # Properties:
# repository # methods:
# lend money
# store money pass class data_file:
# worker relative strength
# unemployment rates
# worker consciousness
# worker eductational levels
# degree of democracy
# cost of living for workers' family