- Timestamp:
- 01/10/12 04:02:00 (4 months ago)
- Location:
- simo/trunk
- Files:
-
- 4 edited
-
simulator/xml/model_chains/tree_simulator/Chain_update_basic_attributes.xml (modified) (1 diff)
-
src/simo/output/aggr.py (modified) (2 diffs)
-
src/simo/simulation/caller/predictionmemory.py (modified) (2 diffs)
-
src/simo/simulation/sim.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simo/trunk/simulator/xml/model_chains/tree_simulator/Chain_update_basic_attributes.xml
r2652 r2680 487 487 </model> 488 488 </task> 489 490 489 <task name="Calculate for non-seedling stand"> 491 490 <condition>comp_unit:pure_seedling eq 0</condition> -
simo/trunk/src/simo/output/aggr.py
r2478 r2680 441 441 constraints=constraints) 442 442 data2 = set([d for d in data2]) 443 # sort data2 by date and reverse it 444 data2 = sorted(data2, key=lambda row: row[1]) 445 data2.reverse() 443 446 for range in date_ranges: 444 447 for row in data: … … 449 452 continue 450 453 if row[0] == row2[0]: 454 # in case single range contains records at 455 # multiple dates, we should take the key 456 # values from the last record (which should be 457 # the first item in reversed data2) 458 if len(row[3:]) >= len(keys): 459 continue 451 460 row += row2[2:] 452 461 data = [d[1:] for d in data] -
simo/trunk/src/simo/simulation/caller/predictionmemory.py
r2594 r2680 132 132 orig_timesteps = self._time_steps[tind[:,0],tind[:,1],tind[:,2],ind] 133 133 no_block = timesteps != orig_timesteps 134 135 134 block = enddate >= cdates 136 135 if numpy.any(timesteps < 0): … … 172 171 # time span unit are the same, and if not, modify the time divider 173 172 # and time steps accordingly 174 timesteps, timedivider = self._match_spans(sim, timeunit, 175 sim.timespan.unit, 176 timespan, timesteps) 173 timesteps, timedivider = self._match_spans(sim, timeunit,\ 174 sim.timespan.unit, timespan, timesteps) 177 175 if timedivider is None: 178 176 return False -
simo/trunk/src/simo/simulation/sim.py
r2673 r2680 19 19 import numpy 20 20 import time 21 import math 21 22 from datetime import date 22 23 from collections import defaultdict … … 675 676 if self.terminate: 676 677 break 677 678 678 679 # update chain index 679 680 self.chain_index += 1 … … 1089 1090 year_as_units = 1. 1090 1091 elif unit == names.MONTH: 1091 units = ((end - start).days - 1.) / 3 0.1092 units = ((end - start).days - 1.) / 31. 1092 1093 year_as_units = 12. 1093 steps = int(units / self.timespan.time_step) + 11094 steps = math.ceil(units / self.timespan.time_step) 1094 1095 timesteps[:] = year_as_units / steps 1095 1096
Note: See TracChangeset
for help on using the changeset viewer.
