存储
DEFAULT_PYDANTIC_MODEL_CONFIG
module-attribute
¶
DEFAULT_PYDANTIC_MODEL_CONFIG = ConfigDict(strict=False, arbitrary_types_allowed=True, extra='ignore', validate_by_alias=True, validate_by_name=True, coerce_numbers_to_str=True, alias_generator=camelize, populate_by_name=True)
StorageProperties
module-attribute
¶
AsrsProperties ¶
CellProperties ¶
储位属性
源代码位于: logis/biz/sim/storage/model/__init__.py
retrieve ¶
ContainerMetadata ¶
容器元数据
源代码位于: logis/biz/sim/storage/model/__init__.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
allowed_stock_type
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
id: Optional[str] = Field(validation_alias=AliasChoices('id', '平堆区编号', '货架编号', '储位编码'), default=None)
name
class-attribute
instance-attribute
¶
can_retrieve ¶
判断当前存储单元是否可以提供指定货物 1. 类型符合 2. 空间足够 3. 未被占用
源代码位于: logis/biz/sim/storage/model/__init__.py
can_store ¶
check_rotation ¶
源代码位于: logis/biz/sim/storage/model/__init__.py
check_width ¶
其实这里为了避免重复逻辑,就要通过反射来获取字段的类型,麻烦了点但是也长了见识
源代码位于: logis/biz/sim/storage/model/__init__.py
get_cells ¶
group_cell_by_stock_type ¶
源代码位于: logis/biz/sim/storage/model/__init__.py
DefaultCellSelectionStrategy ¶
默认储位选择策略
源代码位于: logis/biz/sim/storage/iface/select.py
select_cells ¶
select_cells(operation: OperationType, stock: IStock, rack: Optional[RackClass] = None, strategy: Optional[StorageSelectionStrategy] = None, **kwargs) -> List[CellClass]
源代码位于: logis/biz/sim/storage/iface/select.py
DefaultRackSelectionStrategy ¶
默认货架选择策略
源代码位于: logis/biz/sim/storage/iface/select.py
select_racks ¶
select_racks(operation: OperationType, stock: IStock, rack_group: Optional[RackGroupClass] = None, strategy: Optional[StorageSelectionStrategy] = None, **kwargs)
默认货架选择策略
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
operation
|
OperationType
|
操作类型 |
必需 |
stock
|
IStock
|
货物 |
必需 |
rack_group
|
Optional[RackGroupClass]
|
货架组,如果不传则使用初始化时传的货架组 |
None
|
strategy
|
Optional[StorageSelectionStrategy]
|
此方式实际上不是规范的策略模式,仅仅是为了少写代码 |
None
|
返回:
| 类型 | 描述 |
|---|---|
|
符合操作需求的货架列表 |
源代码位于: logis/biz/sim/storage/iface/select.py
ICell ¶
储位
源代码位于: logis/biz/sim/storage/iface/device.py
__init__ ¶
is_able_to
abstractmethod
¶
判断是否可操作
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
operation
|
OperationType
|
操作类型 |
必需 |
stock
|
IStock
|
货物 |
必需 |
strict
|
bool
|
是否严格判断,即完全能满足所有货物的需求 |
False
|
返回:
| 类型 | 描述 |
|---|---|
bool
|
是否可操作 |
源代码位于: logis/biz/sim/storage/iface/device.py
ICellSelectionStrategy ¶
储位选择策略,从若干储位中筛选出符合操作需求的储位
源代码位于: logis/biz/sim/storage/iface/select.py
select_cells
abstractmethod
¶
select_cells(operation: OperationType, stock: IStock, rack: Optional[RackClass] = None, **kwargs) -> List[CellClass]
从所有可操作的储位中筛选出符合操作需求的储位
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
operation
|
OperationType
|
操作类型 |
必需 |
stocks
|
货物列表 |
必需 | |
rack
|
Optional[RackClass]
|
货架,如果不传则使用初始化时传的货架 |
None
|
返回:
| 类型 | 描述 |
|---|---|
List[CellClass]
|
符合操作需求的储位列表 |
源代码位于: logis/biz/sim/storage/iface/select.py
IExpose ¶
用于通过SDK向外暴露参数
源代码位于: logis/biz/sim/iface/base.py
IRack ¶
货架
源代码位于: logis/biz/sim/storage/iface/device.py
__init__ ¶
is_able_to
abstractmethod
¶
判断是否能完成某个操作
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
operation
|
OperationType
|
操作类型 |
必需 |
stock
|
IStock
|
货物 |
必需 |
strict
|
bool
|
是否严格判断,即完全能满足所有货物的需求 |
False
|
返回:
| 类型 | 描述 |
|---|---|
bool
|
是否能完成操作 |
源代码位于: logis/biz/sim/storage/iface/device.py
IRackGroup ¶
货架组
源代码位于: logis/biz/sim/storage/iface/device.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | |
handle_operation ¶
handle_operation(operation: Union[str, OperationType], stock: IStock, strategy: Optional[str] = None, agent: Optional[IAgent] = None, force_assign_location: bool = False, block: bool = False, rack_selection_strategy: Optional[IRackSelectionStrategy] = None, cell_selection_strategy: Optional[ICellSelectionStrategy] = None, **kwargs) -> Generator[simpy.Event, Any, Tuple[List[IStock], Optional[IStock]]]
完成指定操作
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
operation
|
Union[str, OperationType]
|
操作类型 |
必需 |
stock
|
IStock
|
货物 |
必需 |
strategy
|
Optional[str]
|
操作策略,此字段已废弃,仅保留兼容性 |
None
|
agent
|
Optional[IAgent]
|
所使用的智能体,可选 |
None
|
force_assign_location
|
bool
|
是否强制分配位置 |
False
|
block
|
bool
|
是否等待存取完成 |
False
|
rack_selection_strategy
|
Optional[IRackSelectionStrategy]
|
货架选择策略 |
None
|
cell_selection_strategy
|
Optional[ICellSelectionStrategy]
|
储位选择策略 |
None
|
返回:
| 类型 | 描述 |
|---|---|
(List[IStock], Optional[IStock])
|
(成功操作的货物列表, 失败的货物) |
源代码位于: logis/biz/sim/storage/iface/device.py
handle_operation_until ¶
handle_operation_until(operation: OperationType, stock: IStock, try_interval=5, max_try: Optional[int] = 1, stop_event: Optional[Event] = None, **kwargs)
内部调用handle_operation,直到成功或超过最大尝试次数
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
operation
|
OperationType
|
操作类型 |
必需 |
stock
|
IStock
|
货物 |
必需 |
try_interval
|
尝试间隔,单位秒 |
5
|
|
max_try
|
Optional[int]
|
最大尝试次数,默认1次 |
1
|
stop_event
|
Optional[Event]
|
停止事件,触发后停止尝试 |
None
|
**kwargs
|
其他参数,传递给handle_operation |
{}
|
源代码位于: logis/biz/sim/storage/iface/device.py
IRackSelectionStrategy ¶
货架选择策略,从若干货架中筛选出符合操作需求的货架
源代码位于: logis/biz/sim/storage/iface/select.py
__init__ ¶
select_racks
abstractmethod
¶
select_racks(operation: OperationType, stock: IStock, rack_group: Optional[RackGroupClass] = None, **kwargs) -> List[IRack]
从所有可操作的货架中筛选出符合操作需求的货架
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
operation
|
OperationType
|
操作类型 |
必需 |
stocks
|
货物列表 |
必需 | |
rack_group
|
Optional[RackGroupClass]
|
货架组,如果不传则使用初始化时传的货架组 |
None
|
返回:
| 类型 | 描述 |
|---|---|
List[IRack]
|
符合操作需求的货架列表 |
源代码位于: logis/biz/sim/storage/iface/select.py
IStock ¶
库存\货物接口
源代码位于: logis/biz/sim/stock/model/__init__.py
IStorage ¶
存储设备
源代码位于: logis/biz/sim/storage/iface/device.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
__container__
class-attribute
instance-attribute
¶
__occupied__
class-attribute
instance-attribute
¶
retrieve_strategy
class-attribute
instance-attribute
¶
store_strategy
class-attribute
instance-attribute
¶
__init__ ¶
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
props
|
Optional[StorageProperties]
|
存储设备的属性 |
None
|
exclusive
|
bool
|
是否独占,适用于储位、货架、货架组等 |
True
|
源代码位于: logis/biz/sim/storage/iface/device.py
decrease_jobs ¶
distance_to ¶
获取到货物源头的距离 TODO:其实这里按理说应该包括取货距离和送货距离,且放在这里似乎也不太合适
源代码位于: logis/biz/sim/storage/iface/device.py
increase_jobs ¶
retrieve ¶
取回
源代码位于: logis/biz/sim/storage/iface/device.py
store ¶
存储
源代码位于: logis/biz/sim/storage/iface/device.py
OperationType ¶
操作类型
源代码位于: logis/biz/sim/const/__init__.py
matches ¶
判断是否匹配操作类型,此方法以非严格模式简化判断、兼容历史逻辑
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
operation
|
Union[str, OperationType]
|
操作类型 |
必需 |
返回:
| 类型 | 描述 |
|---|---|
|
是否匹配 |
Point ¶
此类不通用,历史遗留,不建议使用,如有需要建议使用GenericPoint 支持x,y,z三维坐标点,也可当作二维坐标使用 TODO: 处理单位
源代码位于: logis/data_type/point.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | |
__hash__ ¶
源代码位于: logis/data_type/point.py
__init__ ¶
支持[x,y]、x,y、[x,y,z]、x,y,z传参赋值 默认x=y=z=0
TODO: 不应该自动转float、不应该自动保留两位小数
源代码位于: logis/data_type/point.py
__lt__ ¶
__repr__ ¶
__str__ ¶
__sub__ ¶
源代码位于: logis/data_type/point.py
from_tuple
classmethod
¶
of
classmethod
¶
to_tuple ¶
try_parse
classmethod
¶
尝试读取X、Y、Z坐标,返回一个Point对象
源代码位于: logis/data_type/point.py
QuantifiedContainer ¶
初衷是统一simpy的Resource、Container、Store等类型并增加单位的概念,但目前还未完全实现
引入单位的概念,能够简化对simpy的操作,可实现单位换算、检验等功能
源代码位于: logis/biz/sim/storage/iface/container.py
QuantifiedStock ¶
基础货物属性
源代码位于: logis/biz/sim/stock/model/__init__.py
QuantifiedValue ¶
量化值,相比于接口NumberUnit,适合作为数据结构使用
源代码位于: logis/data_type/unitable.py
RackGroupProperties ¶
货架组
源代码位于: logis/biz/sim/storage/model/__init__.py
RackProperties ¶
货架的属性信息
源代码位于: logis/biz/sim/storage/model/__init__.py
cell_metadata
class-attribute
instance-attribute
¶
cells
class-attribute
instance-attribute
¶
col_count
class-attribute
instance-attribute
¶
col_count: Optional[int] = Field(validation_alias=AliasChoices('单元格数', '列数', 'col_count'), default=None)
is_obstacle
class-attribute
instance-attribute
¶
is_obstacle: Optional[bool] = Field(validation_alias=AliasChoices('是否障碍', 'is_obstacle', '是障碍'), default=None)
row_count
class-attribute
instance-attribute
¶
type
class-attribute
instance-attribute
¶
RetrieveStrategy ¶
取回策略
源代码位于: logis/biz/sim/storage/iface/retrieve.py
find_location ¶
find_location(storage: StorageProperties, stocks: List[QuantifiedStock], *args, **kwargs) -> List[CellProperties]
源代码位于: logis/biz/sim/storage/iface/retrieve.py
SpatialProps ¶
空间属性
源代码位于: logis/data_type/spatial.py
depth
class-attribute
instance-attribute
¶
height
class-attribute
instance-attribute
¶
rotation
class-attribute
instance-attribute
¶
rotation: Optional[QuantifiedValue] = Field(validation_alias=AliasChoices('旋转', 'rotate'), default=None)
width
class-attribute
instance-attribute
¶
center_point_validator_before ¶
源代码位于: logis/data_type/spatial.py
Storable ¶
可存储的
使用鸭子类型实现,相比ABC更灵活
源代码位于: logis/iface/container.py
StorageSelectionStrategy ¶
存储选择策略枚举,此枚举试图统一并兼容历史逻辑
源代码位于: logis/biz/sim/const/__init__.py
matches ¶
源代码位于: logis/biz/sim/const/__init__.py
StorageStrategy ¶
存取策略
源代码位于: logis/biz/sim/storage/iface/base.py
find_location ¶
StoreStrategy ¶
存储策略
源代码位于: logis/biz/sim/storage/iface/store.py
find_location ¶
find_location(storage: StorageProperties, stocks: List[QuantifiedStock], *args, **kwargs) -> List[CellProperties]
源代码位于: logis/biz/sim/storage/iface/store.py
Time ¶
euclid_distance ¶
unify_quantified_value ¶
unify_quantified_value(self: QuantifiedValue, target_unit: Optional[Unit] = None, unit_config: UnitConfig = DEFAULT_UNIT_CONFIG, modify_ref: bool = False)
单位转换