设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14311|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' E% V' h6 ^' D: v/ d, b& B

5 c; q0 S0 E$ O0 `0 f5 a我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。" q8 }0 _$ E, H  D- S5 ]$ S$ d
4 u( D* [: {7 ]! l) b+ E1 [
begin P_read arriving0 L% s( ]/ K/ D& e; K2 x
    while 1=1 do begin
* l& Y7 ^6 r/ H  l( T        read A_tote from "data.txt" with delimiter "\n"3 Z6 E3 b- I7 i: b# [
        read A_time from "data.txt" with delimiter "\n"
: b, f+ r. m1 ]' p9 P4 p        read A_leave from "data.txt" with delimiter "\n"
. F" l* [9 {: F/ [* r5 ^        read A_picks from "data.txt" with delimiter "\n"
" U/ @/ I8 [5 ~9 u& a: b        set load type to A_tote. D, G1 P% l& K( m& j, s
        if A_tote="tote 1" then set A_induct to 16 n$ `) A9 y. q" V: S3 X9 \
        else if A_tote="tote 2" then set A_induct to 2
  P8 H5 o" [3 T+ z* J9 ~            else set A_induct to 3   
, w- \: ?3 {& K        set A_i to 0" ?% J6 Z/ I; ?6 A/ H
        clone 1 load to P_induction" I. _$ |2 {# E/ _( }
        wait for A_time sec
9 y: i" k& k$ Z    end
9 o: k' J" _9 F3 a" N1 T" cend
- k6 X. {' s1 U# i, E- l  q& x- Z3 g% R% C
begin P_induction arriving
8 x7 t2 s: w" v. k- j9 j3 Q2 d- V    if A_induct=1 then clone 1 load to P_pick1: S1 T! u1 r, I& S: [
    else if A_induct=2 then clone 1 load to P_pick23 r/ Z0 z) s. k$ U8 A8 X: d' C3 o
        else clone 1 load to P_pick31 b" I+ _- R$ f7 h' Y- f: k% ^
end
# x: P) o8 v6 Z; f0 ^$ r' F# t* d2 ?
% g8 D: `0 \! C% U. h8 K+ l$ U# S' Ebegin P_pick1 arriving
1 U2 B4 V8 ?9 _    set A_i to 1
: s  d4 P( L- ?7 f' x    move into Q_induct1, g* O9 d6 E. F% d- v
    move into pickaisle.induct1
* @# x1 p9 n" C    while A_i<=30 do begin
2 Y7 P: s+ \. ]9 I* z        travel to pickaisle.con(A_i)/ m5 a% i  I/ a4 T4 X  L8 A: U4 ]# K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 P. V8 h" Y$ Y+ Y0 y4 T; J
        else wait for 10 sec+ A4 x# `* Q6 C, T- |1 y: `, p; n
        if A_i=A_leave then send to die
3 X& n, D6 \$ c0 g; U4 Y0 z        else inc A_i by 13 Z( K7 k) R/ c# b' U" p! [
    end
- y/ P1 R, Q3 k4 aend2 P$ ]4 H! v1 H3 I( m: _! p% U5 ?

& b! f  D7 V; l: ?- B7 {: c% abegin P_pick2 arriving, w( F* E6 L. t9 `% H
    set A_i to 11
- I# |: S$ `5 x& L& n: V  d" w: o; E; c    move into Q_induct29 U6 y% o' m" ?% {
    move into pickaisle.induct2( Q4 _) u+ l) \; s9 i7 U
    while A_i<=30 do begin
* C, n" \% n* M2 b  W        travel to pickaisle.con(A_i)
' |1 F$ ?, x7 K, k6 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 [- h% c0 N5 {" I
        else wait for 10 sec
/ \7 R+ N' u" J/ s        if A_i=A_leave then send to die) H8 T( h: G. z5 ^
        else inc A_i by 1+ [: a3 ^- ]6 @: V- {8 P) W5 O
    end
* i" d0 y* a! nend
6 Y3 j! Z- @1 o5 S* u. i: G7 A; t# T2 ~
begin P_pick3 arriving
  j" \6 b5 ?/ [. p- R% I9 |    set A_i to 210 D8 X4 E% b8 w) N. J/ t) C4 L) m
    move into Q_induct3) @# p1 t4 i: n. O+ c
    move into pickaisle.induct3
( D. t% a; R' o5 {& m: K    while A_i<=30 do begin2 L0 d, e4 k/ b
        travel to pickaisle.con(A_i)* ~' {) k" u8 s* L4 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& g# J+ e. E# Y' n2 ~$ I! v
        else wait for 10 sec) [- t2 ?5 j5 r( _
        if A_i=A_leave then send to die1 H+ n# X. k$ p
        else inc A_i by 1
5 p/ x$ ^. j6 D) C% {1 ], u! M    end
. E$ ~: _: N" I! a9 ~# `  s/ i* Vend

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?$ V6 E* e2 A. I+ Y7 D4 l. @' _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- w# G' N7 {' x, [

7 c6 M2 @! D) k7 A+ w( EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! c( e- V" X2 s* u$ m) W

* o$ V, t5 b4 e: H! o" D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 C1 N- f5 r1 X9 @" ^  j
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: _" P7 s. f0 E9 A' d* W0 u+ G2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. \# a/ V7 k% ^3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 p( C" P9 b' M" X6 Y. u) t8 Y7 K1 [
begin P_induction arriving) A( j" t( O2 [. _2 M- D
    clone 1 load to P_pick(A_induct)
# _" W, k- f' X: w. pend最大的系/ ?- m' s0 q+ [0 e0 W- C' {
! Q; v3 G% _! b+ o* v
begin P_pick arriving
' h  g" _3 ]) J    set A_i to procindex * 10 + 1& K% z& v- a1 p' U  M
    move into Q_induct(procindex)
. N, k# t: N4 x6 a' }2 g) q    move into pickaisle.induct(procindex)4 y# _1 F$ K( O' s* G
    /*check the type of pickaisle.induct(i), for your last problem.*/  F; p. k2 P9 M! U! g

1 W5 w1 A: g/ q1 T5 b# A: f: U" y6 h8 F4 V    while A_i<=30 do begin$ T- {, E- [  C' [! I
        travel to pickaisle.con(A_i)
( r8 d  k; z7 F: A( Q% M, s, }# x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 c# w. M9 m3 |* d9 \# N
        else wait for 10 sec
7 z; y0 `9 ~9 ~7 M        if A_i=A_leave then send to die  r2 W9 _2 q# {+ `- M; v; G5 N5 d
        else inc A_i by 1
7 @5 _- t) [  }  W/ e/ Y) L    end
/ L3 v. I+ t) b, Hend0 m5 [9 r0 V6 v( m4 G& b2 N

+ {- s. P3 r; B3 _$ q7 R& f# E其中的procindex为整形,代表当前process的序号。8 a9 H4 W% T( `; m8 g7 i
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-7-1 18:57 , Processed in 0.014331 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表