Skip to content

Commit 32b219f

Browse files
authored
Update fractional_cover_problem.py
1 parent 1d38216 commit 32b219f

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

Diff for: greedy_methods/fractional_cover_problem.py

+1-22
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,9 @@ class Item:
88
weight: int
99
value: int
1010

11-
def __eq__(self, other: object) -> bool:
12-
"""
13-
Compare two Item objects for equality based on weight and value attributes.
14-
15-
Args:
16-
other (object): Another object to compare with.
17-
18-
Returns:
19-
bool: True if the objects are equal, False otherwise.
20-
21-
Examples:
22-
>>> item1 = Item(10, 60)
23-
>>> item2 = Item(10, 60)
24-
>>> item3 = Item(20, 100)
25-
>>> item1 == item2
26-
True
27-
>>> item1 == item3
28-
False
29-
"""
30-
if not isinstance(other, Item):
31-
return False # Return False for non-Item objects
11+
def not_really__eq__(self, other: object) -> bool:
3212
return self.weight == other.weight and self.value == other.value
3313

34-
3514
def fractional_cover(items: list[Item], capacity: int) -> float:
3615
"""
3716
Solve the Fractional Cover Problem.

0 commit comments

Comments
 (0)