
clear all; clear classes;

load session0.mat;

Nitem=CompressedVideos.getarraysize;

for iItem=1:Nitem,
    nMetric=CompressedVideos.getelem(iItem).getmetricscollection.getarraysize;
    for iMetric=1:nMetric,
        
        [~,isCached]=CompressedVideos.getelem(iItem).getmetricscollection.getelem(iMetric)...
            .CheckCache(CompressedVideos.getelem(iItem).getreference,CompressedVideos.getelem(iItem));
        fprintf('In cache: %d \n',isCached);
        
        vals=CompressedVideos.getelem(iItem).getmetrics;
        
        val=vals(iMetric).value;
        
        if ~isCached
            CompressedVideos.getelem(iItem).getmetricscollection.getelem(iMetric)...
                .StoreToCache(CompressedVideos.getelem(iItem).getreference,CompressedVideos.getelem(iItem),val);
        end
    end
end



%%

clear all; clear classes;

load session1.mat;

Nitem=CompressedVideos.getarraysize;

for iItem=1:Nitem,
    nMetric=CompressedVideos.getelem(iItem).getmetricscollection.getarraysize;
    for iMetric=1:nMetric,
        
        [~,isCached]=CompressedVideos.getelem(iItem).getmetricscollection.getelem(iMetric)...
            .CheckCache(CompressedVideos.getelem(iItem).getreference,CompressedVideos.getelem(iItem));
        fprintf('In cache: %d \n',isCached);
        
        vals=CompressedVideos.getelem(iItem).getmetrics;
        
        val=vals(iMetric).value;
        
        if ~isCached
            CompressedVideos.getelem(iItem).getmetricscollection.getelem(iMetric)...
                .StoreToCache(CompressedVideos.getelem(iItem).getreference,CompressedVideos.getelem(iItem),val);
        end
    end
end


%%

clear all; clear classes;

load session2.mat;

Nitem=CompressedVideos.getarraysize;

for iItem=1:Nitem,
    nMetric=CompressedVideos.getelem(iItem).getmetricscollection.getarraysize;
    for iMetric=1:nMetric,
        
        [~,isCached]=CompressedVideos.getelem(iItem).getmetricscollection.getelem(iMetric)...
            .CheckCache(CompressedVideos.getelem(iItem).getreference,CompressedVideos.getelem(iItem));
        fprintf('In cache: %d \n',isCached);
        
        vals=CompressedVideos.getelem(iItem).getmetrics;
        
        val=vals(iMetric).value;
        
        if ~isCached
            CompressedVideos.getelem(iItem).getmetricscollection.getelem(iMetric)...
                .StoreToCache(CompressedVideos.getelem(iItem).getreference,CompressedVideos.getelem(iItem),val);
        end
    end
end


%%

clear all; clear classes;

load session3.mat;

Nitem=CompressedVideos.getarraysize;

for iItem=1:Nitem,
    nMetric=CompressedVideos.getelem(iItem).getmetricscollection.getarraysize;
    for iMetric=1:nMetric,
        
        [~,isCached]=CompressedVideos.getelem(iItem).getmetricscollection.getelem(iMetric)...
            .CheckCache(CompressedVideos.getelem(iItem).getreference,CompressedVideos.getelem(iItem));
        fprintf('In cache: %d \n',isCached);
        
        vals=CompressedVideos.getelem(iItem).getmetrics;
        
        val=vals(iMetric).value;
        
        if ~isCached
            CompressedVideos.getelem(iItem).getmetricscollection.getelem(iMetric)...
                .StoreToCache(CompressedVideos.getelem(iItem).getreference,CompressedVideos.getelem(iItem),val);
        end
    end
end


%%

clear all; clear classes;

load session4.mat;

Nitem=CompressedVideos.getarraysize;

for iItem=1:Nitem,
    nMetric=CompressedVideos.getelem(iItem).getmetricscollection.getarraysize;
    for iMetric=1:nMetric,
        
        [~,isCached]=CompressedVideos.getelem(iItem).getmetricscollection.getelem(iMetric)...
            .CheckCache(CompressedVideos.getelem(iItem).getreference,CompressedVideos.getelem(iItem));
        fprintf('In cache: %d \n',isCached);
        
        vals=CompressedVideos.getelem(iItem).getmetrics;
        
        val=vals(iMetric).value;
        
        if ~isCached
            CompressedVideos.getelem(iItem).getmetricscollection.getelem(iMetric)...
                .StoreToCache(CompressedVideos.getelem(iItem).getreference,CompressedVideos.getelem(iItem),val);
        end
    end
end
