1 |
""" |
2 |
set up of mining activities in modelframe |
3 |
|
4 |
@var __author__: name of author |
5 |
@var __licence__: licence agreement |
6 |
@var __url__: url entry point on documentation |
7 |
@var __version__: version |
8 |
@var __date__: date of the version |
9 |
""" |
10 |
|
11 |
__copyright__=""" Copyright (c) 2006 by ACcESS MNRF |
12 |
http://www.access.edu.au |
13 |
Primary Business: Queensland, Australia""" |
14 |
__license__="""Licensed under the Open Software License version 3.0 |
15 |
http://www.opensource.org/licenses/osl-3.0.php""" |
16 |
__author__="Lutz Gross, l.gross@uq.edu.au" |
17 |
__url__="http://www.iservo.edu.au/esys/escript" |
18 |
__version__="$Revision$" |
19 |
__date__="$Date$" |
20 |
|
21 |
from esys.escript.modelframe import Model |
22 |
from mines import parse |
23 |
|
24 |
class MiningHistory(Model): |
25 |
""" |
26 |
manages the history of mines. It mandels the time steping according to the available |
27 |
data and a dictionary of mass changes per year for all the mines. |
28 |
|
29 |
@ivar history: mine site history file. |
30 |
@type history: C{DataSource} |
31 |
@ivar mass_changes: current mass change per year. |
32 |
@type mass_changes: C{DataSource} |
33 |
|
34 |
""" |
35 |
def __init__(self,**kwargs): |
36 |
""" |
37 |
""" |
38 |
super(MiningHistory,self).__init__(**kwargs) |
39 |
self.declareParameter(t=0., |
40 |
history=None, |
41 |
mass_changes=None) |
42 |
|
43 |
def doInitialization(self): |
44 |
""" |
45 |
initialize time integration |
46 |
""" |
47 |
self.__minesite=parse(open(self.history.getLocalFileName(),'r')) |
48 |
self.mass_changes=self.__minesite.getMassChanges(self.t) |
49 |
|
50 |
def doStepPreprocessing(self, dt): |
51 |
self.mass_changes=self.__minesite.getMassChanges(self.t) |
52 |
print self.t,":",self.mass_changes |
53 |
|
54 |
def getSafeTimeStepSize(self, dt): |
55 |
print "new time marker:",self.t,":",self.__minesite.getNextTimeMarker(self.t) |
56 |
return self.__minesite.getNextTimeMarker(self.t)-self.t |
57 |
|
58 |
|
59 |
|