设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14998|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 _! u. m" G' x: J0 ?8 C$ t

3 b, t- q3 k" Y4 C8 F. G0 i5 w我的问题是,在每个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中的数值,不知道会不会有什么不妥。; j" ]$ k- d/ I/ k
; x  w: }6 v  s! T% C( t
begin P_read arriving
6 Y- _9 J+ `- P2 Q9 ~( k( I& W    while 1=1 do begin
# h$ l. l* z' W7 T" n$ k/ B        read A_tote from "data.txt" with delimiter "\n"
4 d, X' T% y( t1 `4 B        read A_time from "data.txt" with delimiter "\n"
8 T# }5 P5 _: w& s5 v. k9 T& ?        read A_leave from "data.txt" with delimiter "\n"
' z2 q# z) h2 S: M# i. d% G( D        read A_picks from "data.txt" with delimiter "\n"
6 [+ q; V( q0 b& d! W, `        set load type to A_tote& @, \7 E; k: M- p$ d2 w8 ^
        if A_tote="tote 1" then set A_induct to 1
8 D% E" s  |) d        else if A_tote="tote 2" then set A_induct to 2
& }4 }- C7 _: j" S" c+ D% M            else set A_induct to 3   
# s5 [% I# U% [' h        set A_i to 09 V' i* X! P" r7 R9 @3 R/ o- P
        clone 1 load to P_induction
6 U( H/ _% w2 N+ |  J        wait for A_time sec* ?3 j) A" S: J. H0 a6 B
    end
* c7 h+ d2 V4 P: Rend
1 H; n( K! H! k4 g6 l/ g+ r7 t) `% o2 }6 H+ ]6 n3 f: z: n
begin P_induction arriving
8 e6 G  Z; n. K: D/ o    if A_induct=1 then clone 1 load to P_pick1
+ @% Q; p$ P+ @7 P0 U5 ]    else if A_induct=2 then clone 1 load to P_pick2
( x8 e: r7 M/ v, J        else clone 1 load to P_pick3
" T; Z' P; _1 l$ H8 Wend, `2 B' P, Q! Y  b! d. b

/ c5 {- T4 o' K+ m7 @begin P_pick1 arriving
% O; o3 k' j1 E( i) v) J, b6 l, S$ |( X    set A_i to 1$ }4 t9 o: D4 Z3 {4 v2 C
    move into Q_induct1
2 @5 O) m$ u9 @, a, ]" }    move into pickaisle.induct17 n+ I8 X# I3 n  r! }# Y
    while A_i<=30 do begin" ~3 ^& @3 ~7 ~% d# `
        travel to pickaisle.con(A_i)
8 f- D# c0 a7 M" k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! s# Y' @. K6 I( S. |        else wait for 10 sec
; @6 Z1 K- Z1 A$ ~        if A_i=A_leave then send to die& }2 O/ ^8 K9 F# ~% K% n
        else inc A_i by 1, k" q" t6 ~* p- ]: B
    end
. W+ I% w5 V, e2 mend7 v# {7 H' D: L
/ }6 z" ^% D0 {
begin P_pick2 arriving
7 N' s8 l- U( O: D8 e    set A_i to 114 U# B- V) O2 ]
    move into Q_induct2/ T, S% f  b) ~( z5 O' N9 c
    move into pickaisle.induct2$ O" n4 D  z5 {1 S  _; M9 F9 b
    while A_i<=30 do begin: j3 b- ?5 R$ T+ j
        travel to pickaisle.con(A_i)+ \9 ]  ~1 Z& l/ u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 D+ h6 i) x4 T# b$ C& F
        else wait for 10 sec1 t: L" o" t- y/ E, x$ T+ a
        if A_i=A_leave then send to die/ y' s7 S. ^9 c/ K# `/ N
        else inc A_i by 1/ L. X7 {* w& Z9 X! F
    end
$ Z6 \! w: `, l4 }/ _, F; N2 Bend
# u4 ]( Y0 H+ q( P# x6 q: a9 I6 e1 c  j" d
begin P_pick3 arriving, L% H8 j+ ?6 u: V5 f1 H
    set A_i to 21
9 z; @0 s8 x8 R! Y6 \9 b    move into Q_induct3
# q) k: L( P0 `% t3 e- n/ W9 n    move into pickaisle.induct3
2 x( c+ b# ^9 K: H! g+ y    while A_i<=30 do begin
; {$ `5 Z. }3 _9 @" @        travel to pickaisle.con(A_i). c* @" K9 a7 A4 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! p* f% i# z: W        else wait for 10 sec: ?. O0 [$ y  P( l# q9 c) Y. t
        if A_i=A_leave then send to die
) \* m0 q( K0 U0 A$ [        else inc A_i by 1( R: F% C8 w8 Y# ~, N
    end: O  ], }2 G/ e) I" F+ d
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是个什么东东?
2 y7 n3 X- S* V; O# Imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- D; ~) q1 _& H
/ H# B% w  A2 M# J& m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) p" L+ Q" S7 A: M1 n% W/ v! G/ p
1 g+ p2 a/ f  S  t
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 P- A3 ?& Y. W1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! c3 l0 M, W4 Q( a4 b2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" S2 [9 \, B& q' ]0 ?% G3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( C. [5 N6 w' }; i
begin P_induction arriving
0 p- l  C6 |$ ~4 A    clone 1 load to P_pick(A_induct), t. Z2 O5 T3 d# f  q4 G
end最大的系
! x" k9 L+ t( }+ ^7 C( [) c& D# n8 W# q; z  v  `
begin P_pick arriving, ]0 x8 N& v1 c) ?+ s  f
    set A_i to procindex * 10 + 16 }% O' O) r4 J  t. p; F) O& Q- G
    move into Q_induct(procindex)
1 |3 A; B/ j" B- K/ T* n    move into pickaisle.induct(procindex)
' b, m3 r6 K( L1 T# C7 J    /*check the type of pickaisle.induct(i), for your last problem.*/
/ X, C. y/ R# q$ c7 e" N& _# X* \+ J# D) }3 k- ^9 \- f6 s$ c9 b
    while A_i<=30 do begin: W% H! N& t! A. u
        travel to pickaisle.con(A_i)
4 f  e; Q+ a: V4 U/ Y+ P; i% C3 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ D7 U1 [: I+ \" I        else wait for 10 sec
; Y5 W6 c" ~9 I7 h$ d) X        if A_i=A_leave then send to die% ^% T; H+ q7 z: D
        else inc A_i by 1
7 z+ u  f; x, k. g7 M! H    end# T1 j! P9 k1 K
end6 G' F5 g8 ~$ m1 U

' S0 M2 ]5 p: x4 T其中的procindex为整形,代表当前process的序号。
# H9 Q! `2 g" A8 i  c; Y) sstation和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-8-2 21:34 , Processed in 0.019295 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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