mirror of
https://github.com/gsi-upm/soil
synced 2024-11-22 03:02:28 +00:00
parent
6118f917ee
commit
3b2c6a3db5
@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [0.14.9]
|
||||||
|
### Changed
|
||||||
|
* Seed random before environment initialization
|
||||||
## [0.14.8]
|
## [0.14.8]
|
||||||
### Fixed
|
### Fixed
|
||||||
* Invalid directory names in Windows gsi-upm/soil#5
|
* Invalid directory names in Windows gsi-upm/soil#5
|
||||||
|
@ -1 +1 @@
|
|||||||
0.14.8
|
0.14.9
|
@ -44,6 +44,8 @@ class Environment(nxsim.NetworkEnvironment):
|
|||||||
topology=None,
|
topology=None,
|
||||||
*args, **kwargs):
|
*args, **kwargs):
|
||||||
self.name = name or 'UnnamedEnvironment'
|
self.name = name or 'UnnamedEnvironment'
|
||||||
|
seed = seed or time.time()
|
||||||
|
random.seed(seed)
|
||||||
if isinstance(states, list):
|
if isinstance(states, list):
|
||||||
states = dict(enumerate(states))
|
states = dict(enumerate(states))
|
||||||
self.states = deepcopy(states) if states else {}
|
self.states = deepcopy(states) if states else {}
|
||||||
@ -55,12 +57,11 @@ class Environment(nxsim.NetworkEnvironment):
|
|||||||
self.interval = interval
|
self.interval = interval
|
||||||
self._history = history.History(name=self.name,
|
self._history = history.History(name=self.name,
|
||||||
backup=True)
|
backup=True)
|
||||||
|
self['SEED'] = seed
|
||||||
# Add environment agents first, so their events get
|
# Add environment agents first, so their events get
|
||||||
# executed before network agents
|
# executed before network agents
|
||||||
self.environment_agents = environment_agents or []
|
self.environment_agents = environment_agents or []
|
||||||
self.network_agents = network_agents or []
|
self.network_agents = network_agents or []
|
||||||
self['SEED'] = seed or time.time()
|
|
||||||
random.seed(self['SEED'])
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def agents(self):
|
def agents(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user