Hacker Newsnew | past | comments | ask | show | jobs | submit | abcanthur's commentslogin

Does anybody have experience with these? I assume they behave like Corelle, with the million piece explosion when they do break? I just cracked my German PYREX beaker for coffee 10 days ago :(


I've looked into optaplanner/timefold but never ended up using or experimenting with it. Can anyone compare the experience to OR tools?


(Disclosure: I work for Timefold) OR Tools is a MIPS/SAT solver, while Timefold is a meta-heuristic solver. As a result, the developer experience is quite different:

- In OR Tools, you need to write your constraints as mathematical equations. You can only provide your own function in a few scenarios, such as calculating the distance between two points. This allows OR Tools to eliminate symmetries and calculate gradients to improve its solution search. In Timefold, your constraints are treated like a black box, so your constraints can use any function and call any library you like (although you shouldn't do things like IO in them). However, since said constraints are a black box, Timefold is unable to eliminate symmetries or calculate gradients.

- In OR Tools, you have very little control in how it does its search. At most, you can select what algorithm/strategy it uses. In Timefold, you have a ton of control in how it does its search: from what moves its tries to adding your own custom phases. If none are configured, it will use sensible defaults. That being said, certain problems strongly benefit from custom moves.

- In OR Tools, you do not need to create custom classes; you create variables using methods on their domain model classes. In Timefold, you need to define your domain model by creating your own classes. This adds initial complexity, but it makes the code more readable: instead of your variable being an int, it is an Employee or a Visit. That being said, it can be difficult for someone to design an initial model, since it requires an understanding of the problem they are solving.

All in all, when using Timefold, you need to think in a more declarative approach (think Prolog, SQL, etc). For example, let say you have a room assignment problem where a teacher can only teach at a single room at once, and minimize room changes. In Timefold, it may look like this:

    # Typically would be stored in a parameterization object, but a global var
    # is used for brevity
    teacher_count = 3
    
    @planning_entity
    @dataclass
    class Room:
        id: Annotated[int, PlanningId]
        date: int
        name: str
        # This can also be a Teacher object, but str is used for brevity here
        teacher: Annotated[str, PlanningVariable] = field(default=None)
    
    
    @planning_solution
    @dataclass
    class Timetable:
        rooms: Annotated[list[Room], PlanningEntityCollectionProperty]
        teachers: Annotated[list[str], ValueRangeProvider]
        score: Annotated[HardSoftScore, PlanningScore] = field(default=None)


    @constraint_provider
    def timetable_constraints(cf: ConstraintFactory):
        return [
            cf.for_each_unique_pair(Room, Joiners.equal(lambda room: room.date), Joiners.equal(lambda room: room.teacher))
              .penalize(HardSoftScore.ONE_HARD)
              .as_constraint('Teacher time conflict'),
            cf.for_each_unique_pair(Room, Joiners.equal(lambda room: room.teacher))
              .filter(lambda a, b: a.name != b.name)
              .penalize(HardSoftScore.ONE_SOFT)
              .as_constraint('Minimize room change')
        ]


    solver_config = SolverConfig(
        solution_class=Timetable,
        entity_class_list=[Room],
        score_director_factory_config=ScoreDirectorFactoryConfig(
            constraint_provider_function=timetable_constraints
        ),
        termination_config=TerminationConfig(
            spent_limit=Duration(seconds=5)
        )
    )

    solver_factory = SolverFactory.create(solver_config)
    solver = solver_factory.build_solver()
    problem: Timetable = build_problem()
    solver.solve(problem)
Compared to OR Tools:

    teacher_count = 3
    problem: Timetable = build_problem()
    model = cp_model.CpModel()
    objective = []
    room_vars = [cp_model.model.new_int_var(0, teacher_count - 1, f'room_assignment_{i}' for i in range(len(problem.rooms)))]
    room_vars_by_date = {date: [room_vars[i] for i in range(len(problem.rooms)) if problem.rooms[i].date == date] for date in {room.date for room in problem.rooms}}
    room_vars_by_name = {name: [room_vars[i] for i in range(len(problem.rooms)) if problem.rooms[i].name == name] for name in {room.name for room in problem.rooms}}
    for date, date_vars in room_vars_by_date.items():
        model.AddAllDifferent(date_vars)
    for name, name_vars in room_vars_by_name.items():
        for assignment_1 in names_vars:
            for assignment_2 in names_vars:
                if assignment_1 is not assignment_2:
                    objective.add(assignment_1 != assignment_2)
    
    model.minimize(sum(objective))
    solver = cp_model.CpSolver()
    status = solver.solve(model)


To help explain his reputation, he was extraordinarily influential and prolific (400+ completed buildings). His first 20 yrs of work was published as the Wasmuth Portfolio in Europe in 1910; basically all the great European architects who started Modernism had a copy, and even more studied under him at Taliesin. His space planning was revolutionary in the West, his Usonian homes were technologically and sociologically innovative, his many writings are often incisive. To the mentions of his buildings deteriorating; they were unusual, made of new materials, and many residential (no budget for upkeep). He should be regarded as an architect, not an engineer; these fields are almost entirely separate now. And he had great engineering successes, his Imperial Hotel in Japan famously survived a major earthquake. In my opinion he's underrated (even being the most famous American architect) probably because he was so stylistic (a virtuoso) and he was a half generation older than the more significant wave of Modernists. Go to the Guggenheim, the Marin Civic Center, Oak Park Illinois, Hollyhock, Taliesin East and West, his buildings really hum.


I have a small raised bed dedicated to my first Three Sisters growing right now. Just planted beans a few days ago now that corn has had a head start. Rookie gardener, but hoping for at least some visual interest if not production. The beans are supposed to fix nitrogen which helps the other plants, but does anyone know if this requires a year to pass where the old bean plant decomposes into the soil? Or is merely bean plant presence enough to share nitrogen?


My understanding is that the nitrogen-fixing is actually done by bacteria that they have a symbiotic relationship with. How cool!


It's bacteria that live in the bean roots that do it continuously. Read more about rhizobia here: https://www.gardenbetty.com/a-look-at-legumes-rhizobia-and-r...


For those who don't want to read the article, it's important to note that if rhizobia are not present in your soil, you may want to inoculate your soil with it to get things going. It doesn't come along for free with a bean or pea seed, although some rhizobia are present in most soil.


I think they have to die and turned into compost, so the benefit is for the next season.

It’s similar for notill techniques — it can take five seasons before it hits a threshold and the soil becomes more productive than with conventional methods.


Interesting point, never thought of it before, although I knew about nitrogen fixation. Google the term, Wikipedia may have the answer. I will too.


for the World Cup and most other leagues, the platonic ideal of speed/freshness, information density, and legibility, is https://plaintextsports.com . It has a great World Cup presentation which can display by group or by date https://plaintextsports.com/world-cup/2022/schedule . The page sizes are something like 3 magnitudes smaller than ESPN.com, especially great for when you're actually at the game and the network is bogged down in the arena.


As a terminal lover this is amazing.


I'm curious how you loaded this in the terminal, because for me, curl spit out a ton of HTML and very little plain text. I suppose with curl only asking for `/`, I should be happy with what I got, but even when asking for plain text, I got HTML. I didn't mean to go all "no true Scotsman" on this reply, but I wish something called Plain Text Sports had actually returned plain text to me in a terminal.


I only meant that I love text based interfaces. I only know of one other example that looks good in both terminal and web: https://wttr.in


Pockets of extra sour!? Fascinating, what is her secret?


I asked her - she said it happens because it's not mixed properly lol. Specifically, she said it happened because I didn't get her enough notice and so she shortened the process, not refolding and restretching as much as she normally would.


noise transmission (and the reduction thereof) is affected by all aspects of building design. A wood building will not always be noisy. More expensive buildings tend to have multiple mitigations in place for sound transmission. These can be multiple special purpose layers in floors and walls, from elastic layers that are only a few mm thick, to inches of poured concrete present only for the sound response. A technique in very nice stick-built (the 5-over-1s mentioned) buildings is to have walls built with different structural systems for either side of the wall. Two layers of drywall on a single structural wall acts like a membrane, transmitting sound to the other side. Attaching drywall to disconnected structures greatly inhibits that vibration, at the cost of a thicker wall (lost rentable sqft) and ~2x spent on structure.


For a very similar but different up and down story arc that both makes one appreciate the value of one's own mental faculties, and stirs compassion for those with diminished abilities, I highly recommend the movie "Awakenings." https://en.wikipedia.org/wiki/Awakenings De Niro and Robin Williams, based on an Oliver Sacks book, which I haven't read but it probably great.


Too sad to watch more than once.


It’s fine, I’m the next episode Charlie goes back to bashing rats.


There (should) be a very small rectanglular sign right below the stop sign that says "4 way" meaning there are stops on all 4 corners. I've always thought these were way too small to notice and I wouldn't be surprised if they were often missing.


Those aren't there (at least not reliably) in California. One of the most frustrating parts of driving here for me too.


Great site, I've been using it for months. It's a really different and richer experience at night when the games are in progress. There are added features for the big leagues, such as the NBA games feature a game flow graph of the scoring margin. It truly shines when you're at a sold out NBA game, you can barely get a tweet out due to the crowd size, but you can still refresh the box score of your own game in <second to check on foul trouble.


That is very neat, and great use of a low bandwidth style site. On the other hand at the NBA games I’ve been to they have the box score on the jumbotron.


true, but usually only for players currently on the court and who knows what direction you'll have to rubberneck to read it. This is one instance where I like mixing the small mobile screen w my real world view, it's an augmented reality!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: