设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13860|回复: 2

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

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

: g# T) N& Z) A$ t% b3 z我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 m5 W" ^5 i* B0 W1 {+ y

. U6 N, S; _7 M/ P  C( [# V# g5 Vbegin P_read arriving
2 p! ]: `! h% W    while 1=1 do begin
/ Q1 q# K7 ^& n$ u3 C; [        read A_tote from "data.txt" with delimiter "\n"
5 x- e" n% u2 R  r7 p) @/ }1 N: B/ Z        read A_time from "data.txt" with delimiter "\n"/ q6 p" z  W! L  x& [. w0 L
        read A_leave from "data.txt" with delimiter "\n"! Y8 F) `( V. L! y0 M  ~
        read A_picks from "data.txt" with delimiter "\n"
! C: z, J2 u  h3 ~' k        set load type to A_tote9 k6 Z. W- a6 X  \" B2 t
        if A_tote="tote 1" then set A_induct to 1; O9 {4 D5 d2 h% R& z- v8 q
        else if A_tote="tote 2" then set A_induct to 2
4 k- ]4 z9 T( w  W: b            else set A_induct to 3   
# z% }& i+ m, Y6 E4 w% F5 {        set A_i to 0) V4 V% q/ {  i8 T7 y; c" f
        clone 1 load to P_induction# n- }* o$ U) a5 i9 Y0 B
        wait for A_time sec: O4 a6 S% Q# X4 W
    end
' `+ p- p8 M" }! O% @" eend
" L: v$ }) Q8 W. L1 S3 l( Q) }6 }; K) b3 d/ s( \8 x5 c
begin P_induction arriving
  y1 z/ y! s/ t  d1 E9 K7 D$ p    if A_induct=1 then clone 1 load to P_pick1: s4 s# b8 l8 E9 d( }% \  }. J- i, ~
    else if A_induct=2 then clone 1 load to P_pick2! b9 o6 a* h* L9 S
        else clone 1 load to P_pick3
( o4 p; O  k8 p. Q  ]5 L1 @1 Fend
+ a9 P7 z: u7 q, j+ W) z+ x+ ^2 p, e8 V' [0 J
begin P_pick1 arriving
- u, w6 G7 |8 p- e& J  x8 o3 Q! o' ?    set A_i to 1
. W6 N8 X0 M+ _9 \/ W; C( C    move into Q_induct1
$ |9 A; s* r( K2 |. a, U8 b    move into pickaisle.induct1
  C: l  |) E4 G0 T# z4 w. C% [    while A_i<=30 do begin
6 J6 d( W- _& C0 ^4 |        travel to pickaisle.con(A_i)
# g8 [' o" v$ w2 R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! [/ n1 ~! a  E1 n/ o. ]3 p        else wait for 10 sec
6 _& n/ Y- Y, D9 u, K5 L        if A_i=A_leave then send to die
& H2 |: [  g( _5 v        else inc A_i by 1
# x: |% _6 q  {9 n' b- Q    end6 `7 W- u- S4 a$ A
end! ~/ p1 D4 N5 J9 M2 P; A

8 n8 c- O: i6 ?; t$ Nbegin P_pick2 arriving
9 k2 B2 {# q- C% h9 ^& S! j+ W    set A_i to 11
: i$ W: m2 R6 U! L& x* {) H. ^    move into Q_induct2: F" t. X+ A  A/ q
    move into pickaisle.induct2( z: ^9 ]6 t- L- z7 b+ R9 f
    while A_i<=30 do begin* N, @1 ~* a4 F$ A$ ?5 e
        travel to pickaisle.con(A_i)8 E0 j+ N4 }, s7 y4 }3 q- _$ Z# _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- S  Q# ~" u0 q- G4 |0 u
        else wait for 10 sec! S+ ^0 u0 L( X- W7 \
        if A_i=A_leave then send to die* Z5 ]5 w) L9 [
        else inc A_i by 10 y  B7 O& e4 b' ]9 S4 u2 C6 U$ K: l
    end
. F# z8 s# s2 Qend
: \/ p0 W% F- {: A- b3 X  B+ L; I; |! J: O  s
begin P_pick3 arriving
' z- y* D" `% M2 B    set A_i to 21
( b8 g3 I! L# a( N. F! n    move into Q_induct3: e* m+ @6 P. ~% x
    move into pickaisle.induct3
; n9 j( {3 d2 l+ t$ K    while A_i<=30 do begin
6 d1 F" _0 V5 c        travel to pickaisle.con(A_i)! Q2 R, G7 v3 F6 Y3 K/ b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 }) W& u6 k" q. D0 S        else wait for 10 sec
+ v; P- a2 o' |, @; s" v, Y  P        if A_i=A_leave then send to die4 l( U4 C% K6 z$ W5 I; {
        else inc A_i by 11 L! y, v/ A- m& E# ]
    end8 [# ]" `/ I0 j+ A- {. p0 E) M" m
end

最佳答案

查看完整内容

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是个什么东东?3 w, a) _* r9 W& ~1 [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. z0 l* F6 {' [" Y3 }( ?! ^) p: J, M3 t
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ t- X( e$ V; H- x$ Z  u% u4 I
$ V( j! H9 l$ u* H0 l4 o" B另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 d8 Y5 Q+ |" B) B) Y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% T: u" K3 @* {# L( V2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 U/ u3 h0 W+ U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 `0 ?+ ^% \+ L5 H: w) ~7 [3 l
begin P_induction arriving
* {0 p! j+ d7 c- x% E/ b% X    clone 1 load to P_pick(A_induct)
( x% Q7 f, x2 v& ~) j" Gend最大的系
! {/ u9 z' r# o2 H/ Y$ M3 f( q9 v3 I8 r1 }, Q$ x% q
begin P_pick arriving& d3 e. I, f9 ?) ]
    set A_i to procindex * 10 + 1
# f. p; E* k+ w8 m+ d    move into Q_induct(procindex)- W8 K9 Q5 w' @. A( b
    move into pickaisle.induct(procindex)
" l5 [' ]$ i% e3 D1 ]- a2 m    /*check the type of pickaisle.induct(i), for your last problem.*/+ Z7 r2 m/ m! U2 p, r% F+ o
' V; W* K. e+ l4 N% b3 P3 r* _
    while A_i<=30 do begin
. Z4 s5 X( D- @) ?1 _. e        travel to pickaisle.con(A_i)2 d$ Q/ f' h3 U8 }! q, D' f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: a7 v2 s5 c5 F
        else wait for 10 sec
$ f- Z6 M2 N! h% Q) U! x" h. _        if A_i=A_leave then send to die% s! E' S9 V! z' ~4 V( D
        else inc A_i by 14 a0 q6 {6 @* ?6 l# S7 _0 c4 N5 ?
    end
5 L1 i( F( h' K/ Kend
* [; S* x9 C" j4 D. n, ~/ v1 {4 w1 a9 d/ R" d; N* R4 [
其中的procindex为整形,代表当前process的序号。( t" ]  ]5 h3 K8 F- w, Z. q: l
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-5-13 06:15 , Processed in 0.016511 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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