changes from zurich; my mac
This commit is contained in:
44
Classes/Warehouse_class/classes/StorageParameter.m
Normal file
44
Classes/Warehouse_class/classes/StorageParameter.m
Normal file
@@ -0,0 +1,44 @@
|
||||
classdef StorageParameter < handle
|
||||
%PARAMETER Summary of this class goes here
|
||||
% Detailed explanation goes here
|
||||
|
||||
properties
|
||||
name
|
||||
values
|
||||
indices
|
||||
length
|
||||
getPhysForIndex = dictionary;
|
||||
getIndexForPhys = dictionary;
|
||||
end
|
||||
|
||||
methods
|
||||
function obj = StorageParameter(name, values)
|
||||
%PARAMETER Construct
|
||||
obj.name = name;
|
||||
obj.values = values;
|
||||
obj.indices = [1:numel(obj.values)];
|
||||
obj.length = length(obj.values);
|
||||
obj = obj.buildIndexForPhysDict();
|
||||
obj = obj.buildPhysForIndexDict();
|
||||
end
|
||||
|
||||
function obj = buildPhysForIndexDict(obj)
|
||||
%take Index
|
||||
%return Phys
|
||||
for idx = 1:numel(obj.values)
|
||||
obj.getPhysForIndex(idx) = obj.values(idx);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function obj = buildIndexForPhysDict(obj)
|
||||
%take Phys
|
||||
%return Index
|
||||
for idx = 1:numel(obj.values)
|
||||
obj.getIndexForPhys(obj.values(idx)) = idx;
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user