Skip to content

Usage of an archive with and without constraints and two objectives #21

@nikohansen

Description

@nikohansen
import moarchiving as moa

a = moa.get_mo_archive(n_obj=2)
a2 = moa.get_cmo_archive(n_obj=2)
a.add([1, 1])
a2.add([1, 1], [3,4,5])
print(type(a), type(a2))
print(a, a2)
print(list(a), list(a2))
len(a), len(a2)
<class 'moarchiving.moarchiving.BiobjectiveNondominatedSortedList'> <class 'moarchiving.constrained_moarchive.CMOArchive'>
[[1, 1]] <moarchiving.constrained_moarchive.CMOArchive object at 0x120cc5670>
[[1, 1]] []
(1, 0)

Questions:

  • How can I see the elements of a2?
  • Is the different behavior of list(.) or len(.) to be expected (by a user) or necessary? It doesn't seem desirable?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingusage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions