#which data structure Should i use for this college project

1 messages · Page 1 of 1 (latest)

oak flax
#

Hey everyone, I'm about to start working on a Java project about a task and event scheduling system in a calendar based on urgency.

For a task, I'll have the following fields:

taskId
taskFrequency
taskName
taskDescription
taskLastDate
taskDuration
For an event:

eventId
eventName
eventDescription
eventDate
eventStartHour
eventEndHour
The system will intelligently and efficiently allocate tasks and events into a calendar (likely using the Google Calendar API). Events must be scheduled on their defined date and within their start and end times, but task scheduling is dynamic.

I’m considering using two algorithms for scheduling: greedy and backtracking:

The greedy algorithm will perform an initial scheduling of tasks based on their urgency, trying to fill the available time slots in the calendar.
Backtracking will come into play if the calendar runs out of space or encounters unresolvable conflicts. It will check the possibility of modifying the schedule for previously allocated tasks to make room for a more urgent task.
Now for the question: What data structure should I use to implement the algorithm?
For a task, I have both priority and a latest possible completion date. This suggests I need an initial sorting based on dates, followed by priority. Additionally, when adding a new task, it could impact the entire calendar.

For example, there might be tasks like studying for an exam, requiring 10 hours that could be split across several days .

gentle geyserBOT
#

<@&987246841693360200> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
Hey everyone, I'm about to start working on a Java project about a task and event scheduling system in a calendar based on urgency. For a task, I'll have the following fields: taskId taskFrequency taskName taskDescription taskLastDate taskDuration For an

ask and event scheduling system in a calendar based on urgency, a priority queue would be the most suitable data structure to use in Java.

A priority queue is a type of queue where each element has a priority associated with it, and the element with the highest priority is always at the front of the queue. This makes it perfect for organizing tasks and events based on urgency, as you can easily add new tasks/events with their respective levels of urgency and retrieve them in priority order.

In Java, you can implement a priority queue using the PriorityQueue class from the java.util package. You can specify a Comparator to define how elements are prioritized based on urgency criteria.

When adding a new task/event to the priority queue, you would assign it a priority value based on its urgency level. The poll() method can then be used to retrieve and remove the highest-priority task/event from the queue.

Overall, using a priority queue will allow you to efficiently manage and schedule tasks and events in your calendar project based on their level of urgency.

oak flax
#

Constraints:

Calendar Availability
The system must ensure that tasks are scheduled only during available times in the calendar. If the user's calendar is full or there are overlaps between tasks, the system should update or rearrange the schedule to ensure the most urgent tasks are completed on time.

Resource Limitations
Each task requires different resources—time, calendar space, or even continuous work hours. Scheduling must consider these limitations. For example, if a task requires one continuous hour but no such time is available, the system should try to split the task or schedule it elsewhere.

Task Dependencies
If there are dependencies between tasks (e.g., one task cannot be performed before another is completed), the algorithm must ensure that the schedule respects the required order of completion. The system cannot schedule tasks that conflict with their dependencies.

Time Constraints and Critical Deadlines
Every task has a critical deadline, which is an important constraint. As a task's deadline approaches, the system must prioritize its completion to avoid missing an important due date.

Flexibility for Unexpected Changes
The system needs to handle unexpected changes in the calendar, such as adding new tasks or postponing existing ones. Such changes might require rescheduling tasks, and the system must ensure that urgent tasks are not disrupted during this process.

I’m not sure yet if I should address task dependencies or not—what do you think?

gentle geyserBOT
#
TJ-Bot
Hey everyone, I'm about to start working on a Java project about a task and event scheduling system in a calendar based on urgency. For a task, I'll have the following fields: taskId taskFrequency t

askName
taskDescription
taskDueDate
taskUrgencyLevel

For an event, I'll have the following fields:

eventId
eventName
eventDescription
eventDateTime
eventLocation

I want users to be able to add, delete, and update tasks and events in the calendar. They should also be able to view all tasks and events sorted by urgency or date.

I'm considering using Java classes to represent tasks and events, with methods for adding, deleting, and updating. I'll also need a way to sort the tasks and events based on urgency or date.

Does anyone have any suggestions or tips for how I can approach this project? Any recommended Java libraries or tools that could be helpful for implementing this functionality?

Feel free to share your thoughts or ask any questions about the project. Let's collaborate and brainstorm ideas together!

oak flax
#

i would like to get a human help

foggy quarry
#

What do you mean by the word "scheduling" ?

#

Inserting it into a database?

stray marlin
#

There are a lot of ways, and some libraries I could recommend. But keep in mind a scheduling application can get complex, and certain libraries will most likely not be allowed.

stray marlin
foggy quarry
#

I would probobly make a Day class that has a date and a array list of CalendarTask class. Then have the Days also be a array list. But im not very smart, theres probably better ways

oak flax
#

inserting directly into google calendar

gentle geyserBOT
#

@oak flax

Your question has been closed due to inactivity.

If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.

Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.

When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.

Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.

With enough info, someone knows the answer for sure 👍

oak flax
#

/deletd

gentle geyserBOT
#

Closed the thread.