Пример #1
0
def rooms_info(simple_r,premium_r, vip_r,saman_caribbean):
    
    for simple_room in saman_caribbean:
        clase = 'Simple'
        cost = simple_room['cost']['simple']
        capacity = simple_room['capacity']['simple']
        hallway = simple_room['rooms']['simple'][0]
        hab = simple_room['rooms']['simple'][1]

        room = Rooms(clase, capacity,cost, hallway, hab)
        simple_r.append(room)
        
    for premium_room in saman_caribbean:
        clase = 'Premium'
        cost = premium_room['cost']['premium']
        capacity = premium_room['capacity']['premium']
        hallway = premium_room['rooms']['premium'][0]
        hab = premium_room['rooms']['premium'][1]

        room = Rooms(clase, capacity,cost, hallway, hab)
        premium_r.append(room)

    for vip_room in saman_caribbean:
        clase = 'VIP'
        cost = vip_room['cost']['vip']
        capacity = vip_room['capacity']['vip']
        hallway = vip_room['rooms']['simple'][0]
        hab = vip_room['rooms']['simple'][1]

        room = Rooms(clase, capacity,cost, hallway, hab)
        vip_r.append(room)

         
    return simple_r, premium_r, vip_r
Пример #2
0
from Rooms import Rooms

rooms = Rooms("input.txt")

# Part 1
print(f'Valid Rooms Sector Id Sum = {rooms.sector_id_sum()}')

# Part 2
decrypted_rooms = rooms.decrypt_room_names()
for dr in decrypted_rooms:
    if dr[0] == "northpole object storage":
        print(f'Sector Id of North Pole Object Storage = {dr[1]}')

Пример #3
0
    ## Flag which notify when the user types 'play'
    "PLAY": False,
    ## Contains the name of the desired room entered by the user
    "TARGET_ROOM": "None",
    ## Contains the color of the detected ball (room)
    "NEW_ROOM_COLOR": "None",
    ## Flag indicating if the FIND mode is active or not
    "FIND_MODE": False
}

## Initialization of the move_base client in order to assign target position to the move_base action server
client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
## Publisher to the startRD topic which allows to enable/disable the room detector
roomD_pub = rospy.Publisher('startRD', Bool, queue_size=10)
## Object of the class Rooms necessary for the knowledge representation of the environment
rooms = Rooms()


## Callback mathod of the UIsubscriber which handels the commands sent by the user.
# @param data is a string message coming from the UI ROS node
def UIcallback(data):
    global control_variables, rooms, client, roomD_pub
    if data.data == "play" or data.data == "Play":
        rospy.loginfo("[CommandManager] Recived a 'play' request!")
        control_variables["PLAY"] = True
        client.cancel_all_goals()
        # stop detecting
        roomD_pub.publish(False)
        time.sleep(3)
    elif data.data == "list":
        rospy.loginfo("The discovered rooms are:")
Пример #4
0
 def open_rooms(self):
     """opens rooms page"""
     self.newwindow = Toplevel(self.window)
     Rooms(self.newwindow)
Пример #5
0
def test_sector_id_sum(file, sector_id_sum):
    rooms = Rooms(file)
    assert (rooms.sector_id_sum() == sector_id_sum)
Пример #6
0
def test_decrypt_room_name(file, decrypted_room_name, sector_id):
    rooms = Rooms(file)
    decrytped = rooms.decrypt_room_names()
    assert (decrytped[0][0] == decrypted_room_name
            and decrytped[0][1] == sector_id)