Names for Data/Storage/StorageState
I don't understand how you can restore the state of an empty storage ? The state should be empty ? Maybe we should rename AbstractStorageState to AbstractDataState because it's the state of the AbstractData ?
Originally posted by @guimarqu in https://github.com/atoptima/Coluna.jl/pull/323
waiting to get some ideas.
EDIT (2021/03/01), 2nd EDIT (2021/03/18):
Todo:
- [x]
StorageStatebecomesRecord - [x]
Storagebecomes(Storage)Unit - [x] change order of arguments in
restore_from_record! - [x]
StorageContainerbecomesStorageUnitWrapper - [x] move storage into
ColunaBase - [x] move
StorageDictintoModel, then deleteAbstractData(new method in model interface) - [x]
StorageDictbecomesStorage - [ ] unit tests on storage "public" methods
Decisions to make :
- [ ] method to instanciate records ? https://github.com/atoptima/Coluna.jl/pull/470#discussion_r596941248
- [ ] method to instanciate units ?
- [ ] remove
NOT_USED(becauseNOT_USEDandREAD_ONLYare the same) (@rrsadykov)
Improve dev Exp :
- [ ]
RecordsVector->Vector{Record} - [x]
StorageDict? ->Storage - [x]
UnitTypePair = Pair{DataType, DataType}? -> removed because now bijection between UnitType & RecordType - [x]
UnitsUsageDict = Dict{Tuple{AbstractModel, UnitTypePair}, UnitAccessMode}? ->UnitsUsage
Conversations to resolve :
- [ ] https://github.com/atoptima/Coluna.jl/pull/471#discussion_r597499436
- [ ] https://github.com/atoptima/Coluna.jl/pull/472#discussion_r597623524
- [ ] https://github.com/atoptima/Coluna.jl/pull/518#discussion_r620311675
Variables to rename :
- [ ] storage / storage unit wrapper in storages.jl
- [ ] storagedict / storage
Needs documentation (or remove)
- [ ]
initialize_storage_units - [ ]
collect_units_to_restore!(why a UnitsUsageDict as first arg ?) - [ ]
store_records(reform) - [ ]
store_records(reform, record_vector) - [ ]
getstorageunit(model, storage_unit_type) - [ ]
record_type
We can rename EmptyStorage to FormulationStorage.
Renaming AbstractStorageState to AbstractDataState is ok for me.
I would also be good to rename RuntimeData (ColGenRuntimeData, TreeSearchRuntimeData, etc) to something else, as now there are two datas in the the algorithms (runtime data and reformulation data). This is not good for the code readability.
It would be nice if we could remove RunTimeData structures in the long run.
We need this kind of structure to keep the intermediate data which is needed only during the run of the algorithm
If you look at column generation, the structure is useless. We use it because we didn't think carefuly about the code design.
I agree that in column generation is not that useful. However, for example, in the tree search algorithm we need to store the tree somewhere.
Todo (cc @rrsadykov) :
Edit : move the list of tasks to do in top comment.
Review
- https://github.com/atoptima/Coluna.jl/blob/d6ef18127dc900987af0acee10fffd5bbc8aab1b/src/Algorithm/formstorages.jl#L12 (not in the interface)
Public
https://github.com/atoptima/Coluna.jl/blob/d6ef18127dc900987af0acee10fffd5bbc8aab1b/src/Algorithm/storage.jl#L329-L359
https://github.com/atoptima/Coluna.jl/blob/d6ef18127dc900987af0acee10fffd5bbc8aab1b/src/Algorithm/storage.jl#L22-L28
When you create a record vector with copy or store, you then must destruct records using restore or remove. Otherwise memory leaks.
Dev
- Create a unit storage
<:AbstractUnitStorage - Define 0 to n record(s) for this unit storage
- Define Pair : Type{<:Unit} => Type{<:Record} (if no record : use
EmptyRecord) - Define constructor for the abstract unit storage : https://github.com/atoptima/Coluna.jl/blob/d6ef18127dc900987af0acee10fffd5bbc8aab1b/src/Algorithm/storage.jl#L41-L44
- Define constructor for the record : https://github.com/atoptima/Coluna.jl/blob/d6ef18127dc900987af0acee10fffd5bbc8aab1b/src/Algorithm/storage.jl#L54-L56
- Define https://github.com/atoptima/Coluna.jl/blob/d6ef18127dc900987af0acee10fffd5bbc8aab1b/src/Algorithm/storage.jl#L60-L66