currentpredictor 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/currentpredictor.rb +1 -34
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6158cc2908a7f51806cf2f43c3fdafe40bd144e
|
4
|
+
data.tar.gz: e432a68c965eb1504b595fc93351728d8d60a494
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f24464bc4e1fe4269b2bb7e3046b0cf9062793ed15eb90b73c0d2ea6a6ce431ac8eb2c99ef7b1827b67623ef02bd2e2aac686d7add6c8a606d1671c4b2f3906
|
7
|
+
data.tar.gz: 47029ab41491e33ad9fd32339deba48849fc81ae0162448c5e31c4d29f9e2a0e1b3f46067cee3e7bc0358ea727abcbcb32a2eb7886b494526cbba0d0173dd50e
|
data/lib/currentpredictor.rb
CHANGED
@@ -3,23 +3,18 @@ module CurrentPredictor
|
|
3
3
|
def self.yearlyconsumption_onrooms(matter,room,cost)
|
4
4
|
consumption = matter
|
5
5
|
cost = cost
|
6
|
-
puts "Enter the number of rooms : "
|
7
6
|
a = room
|
8
7
|
b = consumption*a
|
9
8
|
c = b*cost
|
10
|
-
puts "Yearly consumption of a #{a} BHK rooms in terms of power consumption is #{b} KWH"
|
11
9
|
return a,b,c
|
12
10
|
end
|
13
11
|
|
14
12
|
def self.monthlyconsumption(matter,room,cost)
|
15
13
|
consumption = matter
|
16
14
|
cost = cost
|
17
|
-
puts "Enter the number of rooms : "
|
18
15
|
a = room
|
19
16
|
b = (consumption*a)/12
|
20
17
|
c = b*cost
|
21
|
-
puts "Monthly consumption of a #{a} BHK rooms in terms of power consumption is #{b} KWH and the cost is #{c}"
|
22
|
-
|
23
18
|
return a,b,c
|
24
19
|
end
|
25
20
|
def self.consumption(appliances,regular,cost)
|
@@ -31,57 +26,29 @@ module CurrentPredictor
|
|
31
26
|
appconsumed.each do |key,value|
|
32
27
|
if (key == ammenties)
|
33
28
|
washing = value * watt
|
34
|
-
|
35
|
-
end
|
36
|
-
if (key == ammenties)
|
37
|
-
light = value * watt
|
38
|
-
sum = light+sum
|
39
|
-
end
|
40
|
-
if (key == ammenties)
|
41
|
-
cooker = value * watt
|
42
|
-
sum = cooker+sum
|
43
|
-
end
|
44
|
-
if (key == ammenties)
|
45
|
-
computer = value * watt
|
46
|
-
sum = computer+sum
|
47
|
-
puts "THE SUM OUTSTIDE IS #{sum}"
|
29
|
+
sum = washing+sum
|
48
30
|
end
|
49
31
|
end
|
50
32
|
end
|
51
|
-
puts "THE SUM OUTSTIDE IS #{sum}"
|
52
|
-
|
53
33
|
sum = sum/1000
|
54
|
-
puts "THE SUM OUTSTIDE IS #{sum}"
|
55
34
|
amount = sum * cost
|
56
|
-
puts "Complete consumption per day for you is #{sum} KWH and its cost is #{amount}"
|
57
35
|
month = sum * 30
|
58
36
|
value = cost * month
|
59
|
-
puts "Complete consumption per month for you is #{month} KWH and its cost is #{value} "
|
60
37
|
return sum,month,value
|
61
38
|
end
|
62
39
|
def self.basedonmeter(cost, standardcharge,pslv,previousreading,currentreading)
|
63
40
|
cost = cost
|
64
|
-
puts cost
|
65
41
|
standardcharge = standardcharge
|
66
|
-
puts standardcharge
|
67
42
|
standardcharge = (standardcharge/12).to_i
|
68
|
-
puts standardcharge
|
69
43
|
pslv = pslv
|
70
|
-
puts pslv
|
71
44
|
pslv = (pslv/12).to_i
|
72
|
-
puts pslv
|
73
45
|
previousreading = previousreading.to_i
|
74
46
|
currentreading = currentreading.to_i
|
75
|
-
puts previousreading
|
76
|
-
puts currentreading
|
77
47
|
meterreading = (currentreading-previousreading)
|
78
48
|
finalcost = ((meterreading*cost)+standardcharge+pslv)
|
79
|
-
puts finalcost
|
80
49
|
return meterreading,finalcost
|
81
50
|
|
82
51
|
end
|
83
52
|
end
|
84
53
|
end
|
85
54
|
|
86
|
-
|
87
|
-
|