Skip to content

freePair() results in internal inconsistency in AbstractEnvironment #42

@Wouter1

Description

@Wouter1

AbstractEnvironment extends EIDefaultImpl.

Therefore it inherits the freePair(agent,entity) function

freePair removes its references to the entity (from LinkedList? entities and ConcurrentHashMap<String, HashSet> agentsToEntities)

(BTW interesting but useless attempt here at making EIDefaultImpl thread safe by using ConcurrentHashMap??)

However AbstractEnvironment maintains its own copy of the existing entities: Map<String, Object> entities.

Because AbstractEnvironment never updates its copy when freePair is called, this results in an inconsistent state in AbstractEnvironment. For example, AbstractEnvironment#getEntity will still return the non-removed entity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions