设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10678|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ `+ t- s% v! b$ z  W3 W* V' V7 A
% e# ]# p7 J0 J+ S: O/ X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; }; Q) L  l: u' I6 M7 m

/ d+ j# O4 J+ i/ s! O* i3 Sbegin P_read arriving5 o, {# Z5 L" w, L- V$ u# [
    while 1=1 do begin
0 C% S' w5 z* X' s. j        read A_tote from "data.txt" with delimiter "\n"
1 k7 X' C  V" q% E4 W$ o        read A_time from "data.txt" with delimiter "\n"& j# A- R" Z8 g' E8 c1 i  f( X8 T
        read A_leave from "data.txt" with delimiter "\n"
$ O7 N2 s4 y: W! L9 Z* H& v        read A_picks from "data.txt" with delimiter "\n"
+ s8 p- P8 U, P/ I: H9 I0 H        set load type to A_tote8 n9 }  R% ~+ x
        if A_tote="tote 1" then set A_induct to 1- H) ?' f3 n1 U5 |# T
        else if A_tote="tote 2" then set A_induct to 25 G) A( m& m4 q& B4 x+ R
            else set A_induct to 3    " b  G2 [8 R2 g
        set A_i to 0: g( f6 v2 G3 y! U/ C
        clone 1 load to P_induction( B; w4 f: w5 C4 X) s
        wait for A_time sec
/ M' ?; F* U1 l$ c$ h    end
- l' F- E8 ]$ uend( Z/ Y% N9 N  P9 X5 t

1 ?, d0 ?8 r6 Q. K2 ^: S8 I2 I7 @begin P_induction arriving
8 R) |5 C" u* C    if A_induct=1 then clone 1 load to P_pick1
% k2 u! ]- \  t    else if A_induct=2 then clone 1 load to P_pick26 c9 r1 j" E% J# A( M
        else clone 1 load to P_pick3- X/ k/ l+ g) Y: B
end  X1 v5 I) Y- f; q
" K" \& j/ `) t, t" S: j7 a' ]% Z
begin P_pick1 arriving
' k1 e2 c  {" E) v3 `" n    set A_i to 15 E' d* @# U( y: V
    move into Q_induct1
/ X0 w# q; q& M2 J- j0 ^. {    move into pickaisle.induct1
& P' Z$ {# D* y    while A_i<=30 do begin4 `/ R% S1 j# ^* n$ d
        travel to pickaisle.con(A_i)+ E% i8 [+ X+ M; B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- V' z2 z0 q. \' k+ E
        else wait for 10 sec
& Z5 @! v3 ]; G* `" {$ S* d. i8 t        if A_i=A_leave then send to die3 Y8 U, d  h' S& x! h* d$ \
        else inc A_i by 15 O- S8 L& j. u; k3 m' ]; W
    end
2 j) d) [# z# K2 w, C6 Lend
- p6 ~" w, E1 A0 }% ~
  \/ n" H9 k4 Z4 G" v9 i% d( k4 ibegin P_pick2 arriving" L: z9 I$ R' H5 e
    set A_i to 11
  o- |  x& R2 R* q, Z1 I4 v6 k2 c    move into Q_induct2
& n3 p; k6 T) R    move into pickaisle.induct2( ?# h2 S- t) {" [# n6 @% l
    while A_i<=30 do begin
) e$ G3 N" j. }* n9 I5 _. ?1 `        travel to pickaisle.con(A_i). P' G# A. z0 d, I2 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 k6 q0 C, Q8 y0 |3 r( P
        else wait for 10 sec
% B) r' W" q/ ^0 l, J: H: \$ G& j        if A_i=A_leave then send to die" g+ p* |, H" P7 L
        else inc A_i by 19 Z. ~' A1 {" U4 I# V4 g! J
    end
; |8 ]% @  h+ |/ D) ]2 m' I& T  ]end5 g- m  E( X( D( k; W- V7 g& P

, H, f/ o  W9 {* J( A. _begin P_pick3 arriving( \' j' J/ {, S0 E! @6 x" H, C
    set A_i to 21
- _2 d0 R2 n0 e1 _  K6 x) w* r    move into Q_induct3' p, g0 s" Y5 n1 D/ v" f
    move into pickaisle.induct3
% G) c! c# I8 y& W8 I: b, p    while A_i<=30 do begin( s. ?0 ^3 o  b! N  _/ a. P
        travel to pickaisle.con(A_i)
( b; R9 [; [3 [9 D7 e" l6 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 e, v" G/ h/ q9 Q8 X& c
        else wait for 10 sec! R7 M( q& u# H' t. l  ^, @0 d
        if A_i=A_leave then send to die4 F+ G9 l$ f3 G3 \( \( a! [) U
        else inc A_i by 1; P  B" `' A: }. i! t
    end
9 ~6 j/ O3 v. A  b5 m# n( {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是个什么东东?
- R4 f: X; ~% n- qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, f  |, N) K  e0 Y' ]8 e% {3 E6 d

+ R1 K2 D3 R6 u+ eAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! `* u$ t+ |$ `$ I  I6 B
, q6 c6 `4 o3 }' m" d
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ v' n( L$ z1 K9 w2 v& c
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 Z/ j- n& I6 p0 [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  W" n5 {3 C. f' w8 t3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 s" ?7 Z; X2 C# h) hbegin P_induction arriving+ p3 q9 s" Z5 E5 E6 N
    clone 1 load to P_pick(A_induct)
6 P! N9 F- U) L' a. G) @8 P. @* Oend最大的系
9 E3 }0 {6 D) ]+ \( p2 j; V- y# O) d' ]
begin P_pick arriving
3 U& r" n$ O# m7 z: i: g1 q( ~5 [$ r    set A_i to procindex * 10 + 1
) o/ P7 d8 z5 w) G5 ^# U    move into Q_induct(procindex)
7 C* y' E* n2 S2 ^    move into pickaisle.induct(procindex): Q6 Y; Q! Z) x7 m
    /*check the type of pickaisle.induct(i), for your last problem.*/5 `% D( M! h) E% p
1 T, g5 X  P2 M. J3 i4 P" ~
    while A_i<=30 do begin
5 _$ V- O* B( C) }2 J# U* z        travel to pickaisle.con(A_i)
/ V) h% G( |: Q/ f5 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 ]0 f" i1 K/ O) c, o        else wait for 10 sec
& c- w# W1 G1 J/ e$ T        if A_i=A_leave then send to die4 {" l9 J% L$ ^' g) |  w+ {5 E
        else inc A_i by 1( {7 k4 d/ r. c, X  R5 O6 I0 u' ~
    end8 y& p6 p5 M3 m* g
end
% O& H4 k8 q4 A0 H: a/ a. B7 u+ z6 j& A5 n. b6 E) r, s) I5 f
其中的procindex为整形,代表当前process的序号。
" ^0 A* K7 p7 c: A2 fstation和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, 2025-9-18 22:37 , Processed in 0.018775 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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