New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group entity #175
base: master
Are you sure you want to change the base?
Group entity #175
Conversation
Adding global group entity: - Added necessary group.py files - Changed all necessary files (e.g. __init__) - Study scripts run smoothly (more testing) - So far no functionality to group (is mostly copy of social system)
Added a possible group_network logic
minor typo and some todos
had error in runner: TypeError: 'dict_keyiterator' object cannot be interpreted as an integer [...] in numpy.random.mtrand.RandomState.choice ValueError: a must be 1-dimensional or an integer File "C:\Users\bigma\PycharmProjects\pycopancore\pycopancore\model_components\exploit_social_learning\implementation\culture.py", line 42, in social_update agent_j = np.random.choice(self.acquaintance_network.neighbors(agent_i)) with (self.acquaintance_network.neighbors(agent_i)) being <dict_keyiterator object at 0x00000226F0049F90> FIX: extracting list from key with list() agent_j = np.random.choice(list(self.acquaintance_network.neighbors(agent_i)))
…_network. Error while adding group to a culture (group needs to "live" somewhere, similar to cells for individuals that then give memberships to worlds and so on.
Using an directed from Individual to Group Network to handle n to n group memberships.
…he new group entity
…he new group entity
- Add visualisation of layered group network in run_group_test_seven_dwarfs.py - Fix minor issues
Adding global group entity: - Added necessary group.py files - Changed all necessary files (e.g. __init__) - Study scripts run smoothly (more testing) - So far no functionality to group (is mostly copy of social system)
Added a possible group_network logic
minor typo and some todos
…_network. Error while adding group to a culture (group needs to "live" somewhere, similar to cells for individuals that then give memberships to worlds and so on.
…he new group entity
…he new group entity
- Add visualisation of layered group network in run_group_test_seven_dwarfs.py - Fix minor issues
…g world, environment and metabolism the group lives in via necessary object world that is passed in study script along with culture: M.Group(culture=culture, world=world)
Add some further test: full technical functionality should be given now |
- have one or several "leader" :doc:`individuals<individual>`, | ||
of which one may be the dominant leader | ||
- have an "intra" group network between members :doc:`individuals<individual>` | ||
(this feature is not completely implemented yet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only describe (and explicitly) what feature is implemented and add TODO
tags in the code.
(which will typically interact with the network of personal acquaintance between member individuals) | ||
- (this feature is not completely implemented yet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
|
||
- act as the current "elite" in some :doc:`social system<social system>` | ||
- act as the current "elite" in some :doc:`social system<social system>` (this feature is not implemented yet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here.
|
||
All these relationships may be dynamic. | ||
|
||
Finally, a group may... | ||
|
||
- be a permanent subgroup of a larger group or :doc:`social system<social system>` *by definition* | ||
(rather than by coincidence, e.g., "scientists" are by definition a subgroup of the group "academics", | ||
and "German workers" may be by definition a subgroup of the social system "Germany") | ||
and "German workers" may be by definition a subgroup of the social system "Germany") - (this feature is not implemented yet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here.
@@ -0,0 +1,33 @@ | |||
"""Master data model for group.""" | |||
|
|||
"""https://github.com/pik-copan/pycopancore/blob/master/docs/framework_documentation/abstract_level/entity_types/group.rst""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not add absolute url paths to the code.
self._world = None | ||
self.world = world | ||
|
||
# self._social_system = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove code in comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @zugnachpankow, I did not find any major problems in the code, just some minor style related things.
Fine from my side 🙂
"""cache, depends on self.next_higher_group | ||
and self.next_higher_group.higher_groups""" | ||
# @property # read-only | ||
# def higher_groups(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete commented out code
w._groups.add(self) | ||
self._world = w | ||
|
||
# @property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete commented out code.
readonly=True) | ||
culture = ReferenceVariable("culture", "", type=Culture, | ||
readonly=True) | ||
# higher_groups = SetVariable( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out code
"""Group entity type mixin implementation class.""" | ||
|
||
# standard methods: | ||
# TODO: only uncomment when adding custom code! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out code.
I think the group entity would be at a point to be merged into master. I only ran tests that used the entity with a modified seven dwarfs script, but i also ran exploit (w/o use of group entity) and had no errors due to the implementation of the group entity in the global data structure and the base component. If any problems arise with other studies or whatsoever would be good to know early on.
Changes: