parent
ed77d548aa
commit
851b8001bb
@ -0,0 +1,3 @@
|
|||||||
|
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
|
||||||
|
# Copyright (C) 2020-2021, UChicago Argonne, LLC. All rights reserved.
|
||||||
|
# Released under the modified BSD license. See COPYING.md for more details.
|
@ -0,0 +1,24 @@
|
|||||||
|
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
|
||||||
|
# Copyright (C) 2020-2021, UChicago Argonne, LLC. All rights reserved.
|
||||||
|
# Released under the modified BSD license. See COPYING.md for more details.
|
||||||
|
|
||||||
|
from typing import Dict, Optional, Any
|
||||||
|
|
||||||
|
|
||||||
|
class Sample:
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
data: Optional[Dict[str, Any]] = None,
|
||||||
|
) -> None:
|
||||||
|
if data is None:
|
||||||
|
data = {}
|
||||||
|
self._data: Dict[str, Any] = data
|
||||||
|
|
||||||
|
def get(self, key: str) -> Optional[Any]:
|
||||||
|
if key in self._data:
|
||||||
|
return self._data[key]
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
def put(self, key: str, value: Any) -> None:
|
||||||
|
self._data[key] = value
|
Loading…
Reference in new issue