ppratibha03 / cloudsim

Automatically exported from code.google.com/p/cloudsim
0 stars 0 forks source link

HarddriveStorage confused #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Through reading the source code of CloudSim,an issue confused me for a long 
time,in the HarddriveStorage class,in getFile method 
obj.setTransactionTime(seekTime + transferTime) why not  
obj.setTransactionTime(seekTime + transferTime+latency)

best regards.

Please provide any additional information below.
public File getFile(String fileName) {
        // check first whether file name is valid or not
        File obj = null;
        if (fileName == null || fileName.length() == 0) {
            Log.printLine(name + ".getFile(): Warning - invalid " + "file name.");
            return obj;
        }

        Iterator<File> it = fileList.iterator();
        int size = 0;
        int index = 0;
        boolean found = false;
        File tempFile = null;

        // find the file in the disk
        while (it.hasNext()) {
            tempFile = it.next();
            size += tempFile.getSize();
            if (tempFile.getName().equals(fileName)) {
                found = true;
                obj = tempFile;
                break;
            }

            index++;
        }

        // if the file is found, then determine the time taken to get it
        if (found) {
            obj = fileList.get(index);
            double seekTime = getSeekTime(size);
            double transferTime = getTransferTime(obj.getSize());

            // total time for this operation
            obj.setTransactionTime(seekTime + transferTime);
        }

        return obj;
    }

Original issue reported on code.google.com by tanya33k...@gmail.com on 19 Feb 2012 at 3:58

GoogleCodeExporter commented 8 years ago
In the case of a local hard disk, we assume a very small latency, negligible 
for simulation purposes (we measure simulation in seconds, hard disk latencies 
tend to be smaller than 10ms).

Original comment by rodrigo.calheiros on 22 Feb 2012 at 10:34

GoogleCodeExporter commented 8 years ago

Original comment by rodrigo.calheiros on 22 Feb 2012 at 10:36

GoogleCodeExporter commented 8 years ago
But the seekTime is taken into account and it is around 9 ms. So why not taking 
into account the latency? Otherwise, we should not take into account the 
seekTime too ...

Original comment by baptiste...@live.fr on 10 Feb 2015 at 1:26