Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector< vector<int> > makeMatrix(vector<EndP> end,int endNum , int num_caches, int num_videos)
- {
- //make matrix
- vector< vector<int> > matrix;
- matrix.resize(num_videos);
- for(int i=0;i<num_videos;i++)
- {
- matrix[i].resize(num_caches);
- }
- //clean matrix
- for(int i=0;i<num_videos;i++)
- {
- for(int j=0;j<num_caches;j++)
- {
- matrix[i][j]=0;
- }
- }
- //fill matrix
- for(int i=0;i<endNum;i++)
- {
- for(auto& video: end[i].requests)
- {
- for(auto& cache: end[i].cLatency)
- {
- matrix[video.first][cache.first]+=(end[i].dLatency-cache.second)*(video.second);
- }
- }
- }
- return matrix;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement