设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14424|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 _. M  p6 T3 I7 n8 }
$ H- s7 }6 I. L  z; _7 k' G: K' G9 @4 d我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 \2 c, z4 K& ?' [

' l" ~" b. ~6 k1 Gbegin P_read arriving6 b) [0 T6 }# g$ p1 N# R2 \
    while 1=1 do begin+ N3 [& P% T4 d0 w* V. r
        read A_tote from "data.txt" with delimiter "\n"
" x, j0 o) c& ?1 Y        read A_time from "data.txt" with delimiter "\n"; \4 ^/ ^; c% ^! q6 d
        read A_leave from "data.txt" with delimiter "\n"2 H% ]: @- H9 Q' b1 u, U
        read A_picks from "data.txt" with delimiter "\n"
, m0 A" }: s: q' u        set load type to A_tote) l% ?! Y- f" ^" Q! U4 {
        if A_tote="tote 1" then set A_induct to 1" z+ K/ O$ F1 A$ H
        else if A_tote="tote 2" then set A_induct to 2
' i& a( Q$ L) n$ ?+ p            else set A_induct to 3   
  k/ p4 d  k: m  z# q        set A_i to 0# ]' h- y/ m% \+ L
        clone 1 load to P_induction7 Y' W  T2 _3 W9 c* e
        wait for A_time sec
7 m+ O7 A4 M2 W    end
9 V' ^  H9 ^7 p( b7 o0 Yend6 o6 U" G- J! n# {$ d: b
' w: N. U* j+ X5 C" I
begin P_induction arriving
' n: o+ b" ]! M% }, S    if A_induct=1 then clone 1 load to P_pick12 g8 N; d0 D: G. O
    else if A_induct=2 then clone 1 load to P_pick2# N# ^# ]" \+ {4 Z. \
        else clone 1 load to P_pick3) l$ M7 K: n4 B
end
+ r/ z3 s. d9 v6 M) G: J8 g
) D* A4 I7 ]% m# J% X% jbegin P_pick1 arriving
3 m1 A( \9 b# S7 y/ w    set A_i to 1: k! F: D$ m8 u' U: Z0 ^3 P8 ]' y# Y+ A
    move into Q_induct1
) c  R: i( T. |3 y0 c    move into pickaisle.induct1. i+ j* i% @. Y' ]' V
    while A_i<=30 do begin4 q' h4 ]& b* g5 K
        travel to pickaisle.con(A_i)$ W1 s* E7 G0 r, g6 K  f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- D* c: v5 }* v8 n1 m
        else wait for 10 sec
# E# ]: {3 I, j2 s        if A_i=A_leave then send to die) R) S* F4 ]% ~+ P8 [$ p
        else inc A_i by 1
; F& j1 V. Z: ]/ ~, `    end+ [3 u2 }! l2 G( }6 V9 d7 R
end
# g9 r  Q8 Q8 p$ ~; G! \! e: E- q# G3 S$ i7 V$ B& L" M
begin P_pick2 arriving0 Q3 f2 w0 b9 W0 `) o/ w2 G
    set A_i to 11! B/ h: Q! k! V3 W/ F% C
    move into Q_induct2
$ n; ?% {2 q2 Z2 l1 S' t: q    move into pickaisle.induct2) O5 l) {0 c* D
    while A_i<=30 do begin
* Q+ U+ A( k0 J        travel to pickaisle.con(A_i)
# I) B" K. X. n" Y) d3 s& p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 T- ], ~" P" z5 u6 v/ F, Q6 ^
        else wait for 10 sec3 g% G) b2 b5 {$ ~# H
        if A_i=A_leave then send to die/ i0 \; ~% ^6 y* u$ S  N
        else inc A_i by 17 X8 w: W% V2 t6 s" {
    end3 E: R% e# f: }6 D
end- r1 }% S# p& q* ~! E

: ]2 `' [. u8 Z$ |1 ^% X6 y* q# nbegin P_pick3 arriving
6 W% e& A; o( u7 o2 B+ t7 g; B; O9 ~    set A_i to 21
1 X7 I' a% M& }- R" g    move into Q_induct3
0 c+ }( P0 x$ j: P+ u- L8 W4 M    move into pickaisle.induct3
8 x- L# H5 {! P7 l) a    while A_i<=30 do begin1 O' A) T! L0 H; O
        travel to pickaisle.con(A_i)1 b6 b8 w& X. ^! D1 H1 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! k* M+ X2 J% w8 b        else wait for 10 sec' S) a% \7 S- }! E# \0 h- j
        if A_i=A_leave then send to die5 `/ O3 L: Z6 e. K
        else inc A_i by 1
4 D$ B0 Y/ {6 Z% {. m1 d- `3 o    end
, v. _9 @$ e- P; j0 M0 n2 @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是个什么东东?$ g$ A5 G) L0 T1 S2 S5 \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# b( a  b" Y3 [8 @8 ^) o

$ _9 b4 b6 m. k/ o& J# C( lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- d; e. x  ]! W1 G0 S0 H7 o2 Y, }
9 v& |% |. w- _. @) m另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 B5 P2 q, X) ^: F2 V8 h7 h' P! q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 s3 @6 y) I: J- H' Y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 O+ P( u; Y/ y! c3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- Q; \2 s3 s& w& \
begin P_induction arriving
% f/ z5 T- K( w. Y0 ^  w    clone 1 load to P_pick(A_induct)
2 ?. v3 Q) A7 b+ send最大的系3 B% G4 V% ]* V5 G: J9 k' P

( N' M& w, g8 A% w, Fbegin P_pick arriving: q2 ~, }$ Y& L% C4 H
    set A_i to procindex * 10 + 1
! S$ r; v! a1 [" U    move into Q_induct(procindex)
  i* `/ j- R# j0 Q2 z1 m    move into pickaisle.induct(procindex)
$ p& Q' j) g5 E) L7 A. C; a: k    /*check the type of pickaisle.induct(i), for your last problem.*/& ~: _( z2 U  @' j) j, s6 E
7 v7 |. O! T' u; r" a2 o; l, x
    while A_i<=30 do begin- I( F  r# I! ^0 {" O
        travel to pickaisle.con(A_i)
; W3 d2 M1 @, z8 U$ [& p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  A5 K( \( l/ I* e
        else wait for 10 sec
3 u7 S! v/ I, I* T- N# z+ P6 ?* t        if A_i=A_leave then send to die
8 ?2 F6 c& [7 I0 e8 f% x2 e) R        else inc A_i by 1
# Y% n* |) P( h    end
3 ?  F; M  L+ Dend: @5 n) S+ d& ~) A7 x

, c6 @$ m  ^; n: ~0 e8 C5 B3 }  Z其中的procindex为整形,代表当前process的序号。
- K# ?+ M5 n) V) q" N  O# estation和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-10 21:41 , Processed in 0.015748 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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