source: TI03-DataExtractor/branches/titania_install/pygss/RequestCost.py @ 1520

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/branches/titania_install/pygss/RequestCost.py@1610
Revision 1520, 1.7 KB checked in by astephen, 14 years ago (diff)

This is the live version on titania - changes have been made so safest to SVN it.

Line 
1#   Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ).
2#   This software may be distributed under the terms of the
3#   Q Public License, version 1.0 or later. http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt
4
5"""
6RequestCost.py
7==============
8
9Contains the class RequestCost that is used to estimate the cost (in
10data volume and processing time) of a user request.
11
12""" 
13
14# Import library modules
15import os, sys
16
17# Import package modules
18from serverConfig import *
19from common import *
20from localRules import *
21
22
23class RequestCost:
24    """
25    Class used to estimate the cost of a request in terms of the data
26    volume produced and the processing time to produce the request.
27    There is also a localCostingRules method included for you to add your
28    own algorithms that relate to local rules or specific datasets.
29    """
30           
31           
32    def __init__(self, sessionObject):
33        """
34        Sets up instance variables.
35        """
36        self.bag=sessionObject
37       
38           
39    def localCostingRules(self, estimatedDuration):
40        """
41        Method to be defined by local extractor administrator. Essentially a
42        hook for your local rules and algorithms. It takes in the estimated
43        duration and allows you to alter it as you see fit.
44        """
45        scale_factor=1
46        return scale_factor*estimatedDuration
47
48
49    def getVolumeEstimate(self):
50        """
51        Method to get that the volume of data requested.
52        """
53        pass
54                               
55                       
56    def getDurationEstimate(self):
57        """
58        Method to estimate the time it will take to process a request.
59        """
60        pass
61       
62       
63    def getDurationAndVolume(self):
64        """
65        Returns the estimated duration and volume of the request.
66        """
67        #estDur=self.getDurationEstimate(format)
68        #estVol=self.getVolumeEstimate(format)
69        return (20, 10000000)
70       
Note: See TracBrowser for help on using the repository browser.