Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi A - F > Algoritmi e strutture dati > [Progetto] L'ape bottinatrice
Pages (18): « First ... « 9 10 11 12 [13] 14 15 16 17 » ... Last »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
zac111
.illuminato.

User info:
Registered: Jun 2004
Posts: 243 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 1 Day, 23:50:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

mi calcola il viaggio,poi esce dall'esecuzione e mi segnala l'errore
con la finestrella di invio segnalazione

01-10-2005 09:44
Click Here to See the Profile for zac111 Click here to Send zac111 a Private Message Find more posts by zac111 Add zac111 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lino
.precettore.

User info:
Registered: Jun 2003
Posts: 96 (0.01 al dì)
Location: lodi
Corso: informatica
Anno: terzo
Time Online: 2 Days, 1:25:20 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Scusate, i files da cui la funzioni inserisci legge i valori da associare ai singoli fiori, lo genrate voi?

01-10-2005 11:05
Click Here to See the Profile for lino Click here to Send lino a Private Message Find more posts by lino Add lino to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
maynard80
.novellino.

User info:
Registered: Jul 2007
Posts: 3 (0.00 al dì)
Location: Milano (e non interland, tendo a precisare)
Corso: informatica
Anno: SESTO
Time Online: 12 Days, 14:28:38 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ragazzi non lo so sarò cretino io ma non riesco mica ad applicare Dijkstra al mio albero binario.....

l'unica cosa che ho pensato per trovare il cammino e costruire un albero ternario a parte che sia l'insieme di tutti i cammini e scegliere li il cammino.....

__________________
msn Messenger: giamma80 at tiscali.it
ATHENA !

01-10-2005 12:43
Click Here to See the Profile for maynard80 Click here to Send maynard80 a Private Message Find more posts by maynard80 Add maynard80 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
maynard80
.novellino.

User info:
Registered: Jul 2007
Posts: 3 (0.00 al dì)
Location: Milano (e non interland, tendo a precisare)
Corso: informatica
Anno: SESTO
Time Online: 12 Days, 14:28:38 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ho pensato di costruire per ogni viaggio un secondo albero ternario con i possibili cammini (l'ape per saltare da un fiore ad un altro ha al + 3 possibilità rappresentati dai 3 fiori in avanti)

tale albero deve quindi rispettare le regole di muovimento e deve rispettare la regola per cui:

|deltaY| = oppure > deltaX

se tale regola è rispettata il fiore che sto esaminando può raggiungere il fiore di arrivo.

una volta che ho il mio albero dei cammini guardo il cammino con il peso massimo (magari durante l'inserimento il campo polline lo sostituisco con la somma di tutti i precedenti così che in ogni foglia ho il peso del cammino dalla radice)

è l'unica idea che mi è venuta, ma non vorrei sia un casino

__________________
msn Messenger: giamma80 at tiscali.it
ATHENA !

01-10-2005 13:00
Click Here to See the Profile for maynard80 Click here to Send maynard80 a Private Message Find more posts by maynard80 Add maynard80 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
mitnik
.illuminato.

User info:
Registered: Jun 2002
Posts: 235 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 3 Days, 4:25:25 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by zac111
mi calcola il viaggio,poi esce dall'esecuzione e mi segnala l'errore
con la finestrella di invio segnalazione


anche a me fa cos', mentre in linu tutto ok. Dici che potrebbe essere un problema?

01-10-2005 13:42
Click Here to See the Profile for mitnik Click here to Send mitnik a Private Message Find more posts by mitnik Add mitnik to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
drakend
.grande:maestro.

User info:
Registered: Oct 2002
Posts: 1857 (0.22 al dì)
Location:
Corso:
Anno:
Time Online: 11 Days, 16:15:18 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ciao,
provate gli esempi che ci sono nel file allegato a questo messaggio.
Estraete la directory temp dove vi pare e poi eseguite il vostro programma con input input_a.txt ed input_b.txt in file di output e dopo li confrontate rispettivamente con output_a.txt e output_b.txt.
Ditemi i risultati! Magari usate diff o windiff, così che si evidenzino subito le differenze.

Attachment: temp.rar
This has been downloaded 13 time(s).

Last edited by drakend on 01-10-2005 at 13:52

01-10-2005 13:49
Click Here to See the Profile for drakend Click here to Send drakend a Private Message Find more posts by drakend Add drakend to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
mitnik
.illuminato.

User info:
Registered: Jun 2002
Posts: 235 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 3 Days, 4:25:25 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by mitnik
anche a me fa cos', mentre in linu tutto ok. Dici che potrebbe essere un problema?


ho risolto. Se avete dei problemi con windows controllate tutti i puntatori.

01-10-2005 14:06
Click Here to See the Profile for mitnik Click here to Send mitnik a Private Message Find more posts by mitnik Add mitnik to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Frigging
.primate.

User info:
Registered: Mar 2005
Posts: 69 (0.01 al dì)
Location:
Corso: Informatica
Anno:
Time Online: 8:27:03: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by drakend
Ciao,
provate gli esempi che ci sono nel file allegato a questo messaggio.
Estraete la directory temp dove vi pare e poi eseguite il vostro programma con input input_a.txt ed input_b.txt in file di output e dopo li confrontate rispettivamente con output_a.txt e output_b.txt.
Ditemi i risultati! Magari usate diff o windiff, così che si evidenzino subito le differenze.


Confermo i medesimi risultati.

01-10-2005 14:43
Click Here to See the Profile for Frigging Find more posts by Frigging Add Frigging to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
maynard80
.novellino.

User info:
Registered: Jul 2007
Posts: 3 (0.00 al dì)
Location: Milano (e non interland, tendo a precisare)
Corso: informatica
Anno: SESTO
Time Online: 12 Days, 14:28:38 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by maynard80
ho pensato di costruire per ogni viaggio un secondo albero ternario con i possibili cammini (l'ape per saltare da un fiore ad un altro ha al + 3 possibilità rappresentati dai 3 fiori in avanti)

tale albero deve quindi rispettare le regole di muovimento e deve rispettare la regola per cui:

|deltaY| = oppure > deltaX

se tale regola è rispettata il fiore che sto esaminando può raggiungere il fiore di arrivo.

una volta che ho il mio albero dei cammini guardo il cammino con il peso massimo (magari durante l'inserimento il campo polline lo sostituisco con la somma di tutti i precedenti così che in ogni foglia ho il peso del cammino dalla radice)

è l'unica idea che mi è venuta, ma non vorrei sia un casino


vedo con dispiacere che tutti i miei post vengono snobbati.... :(

__________________
msn Messenger: giamma80 at tiscali.it
ATHENA !

01-10-2005 16:59
Click Here to See the Profile for maynard80 Click here to Send maynard80 a Private Message Find more posts by maynard80 Add maynard80 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
zac111
.illuminato.

User info:
Registered: Jun 2004
Posts: 243 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 1 Day, 23:50:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

spero di no, ora lo provo su linux, ma avete usato djstra?
se non è il massimo della velocità lo terrà buono?

01-10-2005 17:00
Click Here to See the Profile for zac111 Click here to Send zac111 a Private Message Find more posts by zac111 Add zac111 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
drakend
.grande:maestro.

User info:
Registered: Oct 2002
Posts: 1857 (0.22 al dì)
Location:
Corso:
Anno:
Time Online: 11 Days, 16:15:18 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Frigging
Confermo i medesimi risultati.

Ecco volevo dire che è possibile che i programmi selezionino punti diversi su alcuni cammini ottimi: questo accade quando ci sono due possibili punti in un cammino che hanno lo stesso valore. In quel caso non è un baco del programma ma una caratteristica (dipende dall'algoritmo usato per stabilire il cammino critico).

01-10-2005 17:35
Click Here to See the Profile for drakend Click here to Send drakend a Private Message Find more posts by drakend Add drakend to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
maynard80
.novellino.

User info:
Registered: Jul 2007
Posts: 3 (0.00 al dì)
Location: Milano (e non interland, tendo a precisare)
Corso: informatica
Anno: SESTO
Time Online: 12 Days, 14:28:38 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

devo mettere dei percorsi di nodi della mia struttura in un albero ternario, questo albero rappresenta i possibili cammini dal nodo start al nodo end.

code:
typedef int polline; typedef int prato; /*key : indice della posizione del fiore sul piano*/ struct key{ int X; int Y; }; typedef struct key key; /*albero binario: rappresenta i punti del piano*/ struct searchtree { prato id_prato; polline raccolto; key chiave; struct searchtree *left, *right, *up; }; typedef struct searchtree searchtree; /*campo : rappresenta un insieme di prati che hanno punti in comune*/ struct field{ int id_campo; int id_prato; struct field *next; }; typedef struct field field; /*lista di campi*/ field *PRATO_FIORITO; struct routetree{ polline totale; key chiave; struct routetree *left, *right, *center, *up; }; typedef struct routetree routetree; routetree *CAMMINI; routetree *createroutetree(searchtree *start){ routetree *q = malloc(sizeof(routetree)); q->left=q->right=q->center=NULL; q->totale=start->raccolto; q->chiave=start->chiave; return q; } int checkstep(key *step, searchtree *end){ int deltax=(abs)(end->chiave.X - step->X); int deltay=(end->chiave.Y - step->Y); if(deltay>=deltax) return 1; return 0; } routetree *buildroutetree(searchtree *piano, routetree *cammini, searchtree *end){ searchtree *searchtree_tmp; key *key_tmp; if(isMin(cammini->chiave,end->chiave)>0){ key_tmp->X=cammini->chiave.X-1; key_tmp->Y=cammini->chiave.Y+1; if(searchtree_tmp=itsearch(piano, *key_tmp)){ if(checkstep(key_tmp, end)){ cammini->left=malloc(sizeof(routetree)); cammini->left->up=cammini; cammini->left->chiave=searchtree_tmp->chiave; cammini->left->totale=searchtree_tmp->raccolto+cammini->totale; cammini->left->left=buildroutetree(piano, cammini->left, end); cammini->left->center=buildroutetree(piano, cammini->left, end); cammini->left->right=buildroutetree(piano, cammini->left, end); } else cammini->left=NULL; } else cammini->left=NULL; key_tmp->X=cammini->chiave.X; key_tmp->Y=cammini->chiave.Y+1; if(searchtree_tmp=itsearch(piano, *key_tmp)){ if(checkstep(key_tmp, end)){ cammini->center=malloc(sizeof(routetree)); cammini->center->up=cammini; cammini->center->chiave=searchtree_tmp->chiave; cammini->center->totale=searchtree_tmp->raccolto+cammini->totale; cammini->center->left=buildroutetree(piano, cammini->center, end); cammini->center->center=buildroutetree(piano, cammini->center, end); cammini->center->right=buildroutetree(piano, cammini->center, end); } else cammini->center=NULL; } else cammini->center=NULL; key_tmp->X=cammini->chiave.X+1; key_tmp->Y=cammini->chiave.Y+1; if(searchtree_tmp=itsearch(piano, *key_tmp)){ if(checkstep(key_tmp, end)){ cammini->right=malloc(sizeof(routetree)); cammini->right->up=cammini; cammini->right->chiave=searchtree_tmp->chiave; cammini->right->totale=searchtree_tmp->raccolto+cammini->totale; cammini->right->left=buildroutetree(piano, cammini->right, end); cammini->right->center=buildroutetree(piano, cammini->right, end); cammini->right->right=buildroutetree(piano, cammini->right, end); } else cammini->right=NULL; } else cammini->right=NULL; } return cammini; }


questi li spezzoni di codice, ho cercato di creare il primo nodo con il metodo createroutetree() e poi riempirlo ricorsivamente con build routetree()

lo so fa schifo, se qualcuno mi posta il codice per costruire un albero ternario gli offro una birra a Milano (anche 2)

__________________
msn Messenger: giamma80 at tiscali.it
ATHENA !

01-10-2005 22:26
Click Here to See the Profile for maynard80 Click here to Send maynard80 a Private Message Find more posts by maynard80 Add maynard80 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
maynard80
.novellino.

User info:
Registered: Jul 2007
Posts: 3 (0.00 al dì)
Location: Milano (e non interland, tendo a precisare)
Corso: informatica
Anno: SESTO
Time Online: 12 Days, 14:28:38 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

guardate che codice assurdo, non vedete che sto impazzendo, guardate che ore sono....

sono riuscito a rappresentare il piano con un albero binario, riesco a fare l'inserimento, la cancellazione, il numero di campi....... ma non riesco a capire come fare a tirare fuori i percorsi da sto ca@@o di albero, la consegna è tra meno di 48 ore per favore qualcuno mi dia una dritta (anche in pvt) almeno ditemi che struttura d'appoggio usare (questa dell'albero binario è chiaramente una follia)

pleeease!

__________________
msn Messenger: giamma80 at tiscali.it
ATHENA !

02-10-2005 02:05
Click Here to See the Profile for maynard80 Click here to Send maynard80 a Private Message Find more posts by maynard80 Add maynard80 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
maynard80
.novellino.

User info:
Registered: Jul 2007
Posts: 3 (0.00 al dì)
Location: Milano (e non interland, tendo a precisare)
Corso: informatica
Anno: SESTO
Time Online: 12 Days, 14:28:38 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

panico panico, probabilmente gli alberi ternari sono una cazzata....

Dijkstra, per usare questo algoritmo come faccio? nel senso io mio albero binario è ordinato in base alla chiave (X,Y)

ma ad esempio per andare da 0,0 a 2,2 se il cammino esiste esso è per forza 0,0-1,1-2,2

la mia ape si può muovere solo in alto ed in diagonale alta (chiaramente se esistono tutti i nodi che compongono il cammino)

se ci sono + cammini prendo il cammino con il quantitativo di polline maggiore.

ma come si applica Dijkstra ad un albero binario? e che modifiche devo fare??? i valori di polline eventualmente negativi danno problemi???

__________________
msn Messenger: giamma80 at tiscali.it
ATHENA !

02-10-2005 13:20
Click Here to See the Profile for maynard80 Click here to Send maynard80 a Private Message Find more posts by maynard80 Add maynard80 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
zac111
.illuminato.

User info:
Registered: Jun 2004
Posts: 243 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 1 Day, 23:50:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

scusate ma l'output dal punto 8,5 a a 10,14 non viene come
nel testo?????anche a voi aiuto!!!

02-10-2005 14:18
Click Here to See the Profile for zac111 Click here to Send zac111 a Private Message Find more posts by zac111 Add zac111 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 21:08.    Post New Thread    Post A Reply
Pages (18): « First ... « 9 10 11 12 [13] 14 15 16 17 » ... Last »   Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.094 seconds (67.11% PHP - 32.89% MySQL) con 24 query.